[PATCH] D15011: [tsan] Add release+acquire semantics for serial dispatch queues

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 28 01:30:36 PST 2015


dvyukov added inline comments.

================
Comment at: lib/tsan/rtl/tsan_libdispatch_mac.cc:81
@@ -51,2 +80,3 @@
   Acquire(thr, pc, (uptr)context);
+  if (IsQueueSerial(context->queue)) Acquire(thr, pc, (uptr)context->queue);
   context->orig_work(context->orig_context);
----------------
Do you mean that work items can be executed on different threads for serial queues? If so, add a comment here, because it is not completely obvious.

Also, please move Acquire call to a separate line.

================
Comment at: lib/tsan/rtl/tsan_libdispatch_mac.cc:83
@@ -52,2 +82,3 @@
   context->orig_work(context->orig_context);
+  if (IsQueueSerial(context->queue)) Release(thr, pc, (uptr)context->queue);
   user_free(thr, pc, context);
----------------
same here


http://reviews.llvm.org/D15011





More information about the llvm-commits mailing list