1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibPthread: Implement a basic first pthread mutex

This patch adds these API's:

- pthread_mutex_init()
- pthread_mutex_lock()
- pthread_mutex_unlock()

No mutex attributes are supported yet, so we only do the simplest mutex
wihout recursive locking.
This commit is contained in:
Andreas Kling 2019-11-16 12:19:58 +01:00
parent 73d6a69b3f
commit 66a2b582c3
3 changed files with 84 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <sched.h>
#include <stdint.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
@ -8,7 +9,7 @@ __BEGIN_DECLS
typedef int pthread_t;
typedef void* pthread_key_t;
typedef void* pthread_once_t;
typedef void* pthread_mutex_t;
typedef uint32_t pthread_mutex_t;
typedef void* pthread_attr_t;
typedef void* pthread_mutexattr_t;
typedef void* pthread_cond_t;