[PATCH] D33325: [sanitizer] Avoid possible deadlock in child process after fork

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 07:32:26 PDT 2017


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_dense_alloc.h:94
 
+  void ForceLock() {
+    mtx_.Lock();
----------------
This is no more than Lock, please call it Lock. ForceLock produces a false impression that this is something more than just Lock.


================
Comment at: lib/tsan/rtl/tsan_dense_alloc.h:98
+
+  void ForceUnlock() {
+    mtx_.Unlock();
----------------
Same here.


================
Comment at: lib/tsan/rtl/tsan_rtl.cc:458
 void ForkBefore(ThreadState *thr, uptr pc) {
+  allocator()->ForceLock();
+  ctx->metamap.ForceLock();
----------------
Also StackDepotLockAll.


================
Comment at: lib/tsan/rtl/tsan_sync.h:128
 
+  void ForceLock();
+
----------------
Same here.


================
Comment at: lib/tsan/rtl/tsan_sync.h:130
+
+  void ForceUnlock();
+
----------------
Same here.


Repository:
  rL LLVM

https://reviews.llvm.org/D33325





More information about the llvm-commits mailing list