[libc-commits] [libc] [libc] rework mutex (PR #92168)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed May 15 16:13:35 PDT 2024
================
@@ -9,114 +9,74 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_MUTEX_H
#define LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_MUTEX_H
+#include "hdr/types/pid_t.h"
+#include "src/__support/CPP/optional.h"
#include "src/__support/threads/linux/futex_utils.h"
+#include "src/__support/threads/linux/raw_mutex.h"
#include "src/__support/threads/mutex_common.h"
namespace LIBC_NAMESPACE {
-struct Mutex {
+
+// TODO: support shared/recursive/robust mutexes.
+class Mutex final : private internal::RawMutex {
+ // reserved timed, may be useful when combined with other flags.
unsigned char timed;
unsigned char recursive;
unsigned char robust;
+ unsigned char pshared;
- void *owner;
+ // TLS address may not work across forked processes. Use thread id instead.
----------------
michaelrj-google wrote:
👍
https://github.com/llvm/llvm-project/pull/92168
More information about the libc-commits
mailing list