[compiler-rt] r222228 - tsan: add description of AcquireGlobal function

Dmitry Vyukov dvyukov at google.com
Mon Nov 17 22:44:43 PST 2014


Author: dvyukov
Date: Tue Nov 18 00:44:43 2014
New Revision: 222228

URL: http://llvm.org/viewvc/llvm-project?rev=222228&view=rev
Log:
tsan: add description of AcquireGlobal function


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=222228&r1=222227&r2=222228&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h Tue Nov 18 00:44:43 2014
@@ -666,6 +666,12 @@ void MutexReadOrWriteUnlock(ThreadState
 void MutexRepair(ThreadState *thr, uptr pc, uptr addr);  // call on EOWNERDEAD
 
 void Acquire(ThreadState *thr, uptr pc, uptr addr);
+// AcquireGlobal synchronizes the current thread with all other threads.
+// In terms of happens-before relation, it draws a HB edge from all threads
+// (where they happen to execute right now) to the current thread. We use it to
+// handle Go finalizers. Namely, finalizer goroutine executes AcquireGlobal
+// right before executing finalizers. This provides a coarse, but simple
+// approximation of the actual required synchronization.
 void AcquireGlobal(ThreadState *thr, uptr pc);
 void Release(ThreadState *thr, uptr pc, uptr addr);
 void ReleaseStore(ThreadState *thr, uptr pc, uptr addr);





More information about the llvm-commits mailing list