[PATCH] D62258: [scudo][standalone] Introduce the thread specific data structures

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 13:17:16 PDT 2019


cryptoad added inline comments.


================
Comment at: lib/scudo/standalone/tsd_exclusive.h:69
+  NOINLINE void initThread(Allocator *Instance, bool MinimalInit) {
+    if (UNLIKELY(!Initialized))
+      initOnce(Instance);
----------------
morehouse wrote:
> This is unguarded by the mutex.  I think what we need to do is call `initOnce` unconditionally.
My understanding is that it's not needed.
If it's `true` then initialization has been carried, if `false`, then we lock the mutex in `initOnce`.
It's assuming that the bool can't be partially modified, but I guess I should enforce that with an atomic_u8 instead.



Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62258/new/

https://reviews.llvm.org/D62258





More information about the llvm-commits mailing list