[libc-commits] [libc] [llvm] [libc][CndVar] reimplmement conditional variable with FIFO ordering (PR #192748)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Mon Apr 20 13:52:53 PDT 2026


================
@@ -24,16 +25,11 @@ int Barrier::init(Barrier *b,
   b->waiting = 0;
   b->blocking = true;
 
-  int err;
-  err = CndVar::init(&b->entering);
-  if (err != 0)
-    return err;
+  new (&b->entering) CndVar(attr ? attr->pshared : false);
+  new (&b->exiting) CndVar(attr ? attr->pshared : false);
----------------
michaelrj-google wrote:

why was this changed to allocate? In general it's preferable to avoid allocating where possible. Is the benefit here worth the extra complexity?

https://github.com/llvm/llvm-project/pull/192748


More information about the libc-commits mailing list