57 #include <sys/cdefs.h>
84 #define MUTEX_TYPE_NORMAL 1
85 #define MUTEX_TYPE_ERRORCHECK 2
86 #define MUTEX_TYPE_RECURSIVE 3
89 #define MUTEX_TYPE_DEFAULT MUTEX_TYPE_NORMAL
93 #define MUTEX_INITIALIZER { MUTEX_TYPE_NORMAL, 0, NULL, 0 }
96 #define ERRORCHECK_MUTEX_INITIALIZER { MUTEX_TYPE_ERRORCHECK, 0, NULL, 0 }
99 #define RECURSIVE_MUTEX_INITIALIZER { MUTEX_TYPE_RECURSIVE, 0, NULL, 0 }
int mutex_is_locked(mutex_t *m)
Check if a mutex is locked.
int dynamic
Definition: mutex.h:72
int type
Definition: mutex.h:71
int mutex_destroy(mutex_t *m)
Destroy a mutex.
mutex_t * mutex_create() __attribute__((deprecated))
Allocate a new mutex.
int mutex_lock_timed(mutex_t *m, int timeout)
Lock a mutex (with a timeout).
int mutex_lock(mutex_t *m)
Lock a mutex.
int mutex_unlock(mutex_t *m)
Unlock a mutex.
Mutual exclusion lock type.
Definition: mutex.h:70
Structure describing one running thread.
Definition: thread.h:90
struct kos_mutex mutex_t
Mutual exclusion lock type.
int mutex_trylock(mutex_t *m)
Attempt to lock a mutex.
kthread_t * holder
Definition: mutex.h:73
int mutex_init(mutex_t *m, int mtype)
Initialize a new mutex.
int count
Definition: mutex.h:74