libc: pthread: implement mutexes

This commit is contained in:
2026-07-19 13:31:22 +01:00
parent 6317060138
commit 810f741442
4 changed files with 57 additions and 1 deletions
+7 -1
View File
@@ -3,7 +3,9 @@
#include <magenta/types.h>
#define __PTHREAD_ATTR_SIZE__ 32
#define __PTHREAD_ATTR_SIZE__ 32
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) {.__v = 0})
typedef struct __pthread *pthread_t;
@@ -28,4 +30,8 @@ extern int pthread_join(pthread_t thread, void **retval);
extern int pthread_detach(pthread_t thread);
extern void pthread_exit(void *retval);
extern int pthread_mutex_lock(pthread_mutex_t *mut);
extern int pthread_mutex_trylock(pthread_mutex_t *mut);
extern int pthread_mutex_unlock(pthread_mutex_t *mut);
#endif