[libc-commits] [libc] [libc] implement recursive mutex and fix wrong initializer (PR #193992)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Apr 27 13:51:55 PDT 2026


================
@@ -10,20 +10,23 @@
 #define LLVM_LIBC_TYPES___MUTEX_TYPE_H
 
 #include "__futex_word.h"
+#include "pid_t.h"
+#include "size_t.h"
 
 typedef struct {
-  unsigned char __timed;
-  unsigned char __recursive;
-  unsigned char __robust;
-
-  void *__owner;
-  unsigned long long __lock_count;
-
 #ifdef __linux__
   __futex_word __ftxw;
 #else
 #error "Mutex type not defined for the target platform."
 #endif
+
+  unsigned int __priority_inherit : 1;
+  unsigned int __recursive : 1;
+  unsigned int __robust : 1;
+  unsigned int __pshared : 1;
----------------
SchrodingerZhu wrote:

I thought bitfields are in C89? 

https://en.cppreference.com/c/language/bit_field

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


More information about the libc-commits mailing list