+static
+void lttng_metadata_begin(struct lttng_session *session)
+{
+ mutex_lock(&session->metadata_cache->lock);
+ session->metadata_cache->producing++;
+ mutex_unlock(&session->metadata_cache->lock);
+}
+
+static
+void lttng_metadata_end(struct lttng_session *session)
+{
+ mutex_lock(&session->metadata_cache->lock);
+ WARN_ON_ONCE(!session->metadata_cache->producing);
+ session->metadata_cache->producing--;
+ mutex_unlock(&session->metadata_cache->lock);
+}
+