Fix: notifier: use store-release/load-acquire for error counter
[lttng-modules.git] / src / lttng-abi.c
index a9beda756d7bbee4b9127eaec6c9ebb65353045f..838534368d0c018b9ac8cce9940a2a8ad77296fe 100644 (file)
@@ -2144,8 +2144,13 @@ long lttng_abi_event_notifier_group_create_error_counter(
                goto counter_error;
        }
 
-       event_notifier_group->error_counter = counter;
        event_notifier_group->error_counter_len = counter_len;
+       /*
+        * store-release to publish error counter matches load-acquire
+        * in record_error. Ensures the counter is created and the
+        * error_counter_len is set before they are used.
+        */
+       smp_store_release(&event_notifier_group->error_counter, counter);
 
        counter->file = counter_file;
        counter->owner = event_notifier_group->file;
This page took 0.023634 seconds and 4 git commands to generate.