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

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Tue Apr 21 13:51:18 PDT 2026


================
@@ -18,8 +19,8 @@ namespace LIBC_NAMESPACE_DECL {
 static_assert(sizeof(CndVar) == sizeof(cnd_t));
 
 LLVM_LIBC_FUNCTION(int, cnd_init, (cnd_t * cond)) {
-  CndVar *cndvar = reinterpret_cast<CndVar *>(cond);
-  return CndVar::init(cndvar) ? thrd_error : thrd_success;
+  new (cond) CndVar(false);
----------------
SchrodingerZhu wrote:

see also https://github.com/llvm/llvm-project/issues/193139

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


More information about the libc-commits mailing list