KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Definitions for a recursive mutex. More...
Go to the source code of this file.
Typedefs | |
typedef mutex_t | recursive_lock_t |
Recursive lock structure. | |
Functions | |
recursive_lock_t * | rlock_create (void) __depr("Use mutexes instead.") |
Allocate a new recursive lock. | |
void | rlock_destroy (recursive_lock_t *l) __depr("Use mutexes instead.") |
Destroy a recursive lock. | |
int | rlock_lock (recursive_lock_t *l) __depr("Use mutexes instead.") |
Lock a recursive lock. | |
int | rlock_lock_timed (recursive_lock_t *l, int timeout) __depr("Use mutexes instead.") |
Lock a recursive lock (with a timeout). | |
int | rlock_unlock (recursive_lock_t *l) __depr("Use mutexes instead.") |
Unlock a recursive lock. | |
int | rlock_trylock (recursive_lock_t *l) __depr("Use mutexes instead.") |
Attempt to lock a recursive lock without blocking. | |
int | rlock_is_locked (recursive_lock_t *l) __depr("Use mutexes instead.") |
Check if a recursive lock is currently held by any thread. | |
Definitions for a recursive mutex.
This file defines a recursive lock mechanism, similar to a mutex, but that a single thread can obtain as many times as it wants. A single thread is still limited to holding the lock at a time, but it can hold it an "unlimited" number of times (actually limited to INT_MAX, but who's counting).
typedef mutex_t recursive_lock_t |
Recursive lock structure.
Recursive locks are just a simple wrapper around mutexes at this point. You should not use this type in any new code.
recursive_lock_t * rlock_create | ( | void | ) |
Allocate a new recursive lock.
void rlock_destroy | ( | recursive_lock_t * | l | ) |
Destroy a recursive lock.
l | The recursive lock to destroy. It must be unlocked. |
int rlock_is_locked | ( | recursive_lock_t * | l | ) |
Check if a recursive lock is currently held by any thread.
TRUE | If the lock is held by any thread. |
FALSE | If the lock is not currently held by any thread. |
int rlock_lock | ( | recursive_lock_t * | l | ) |
Lock a recursive lock.
l | The recursive lock to lock. |
-1 | On error, errno will be set to EPERM if this function is called inside an interrupt, or EINTR if it is interrupted. |
0 | On success. |
int rlock_lock_timed | ( | recursive_lock_t * | l, |
int | timeout ) |
Lock a recursive lock (with a timeout).
l | The recursive lock to lock. |
timeout | The maximum number of milliseconds to wait. 0 is an unlimited timeout (equivalent to rlock_lock). |
-1 | On error, errno will be set to EPERM if this function is called inside an interrupt, EINTR if the function is interrupted, or EAGAIN if the timeout expires. |
0 | On success. |
int rlock_trylock | ( | recursive_lock_t * | l | ) |
Attempt to lock a recursive lock without blocking.
l | The recursive lock to lock. |
-1 | On error, errno will be set to EWOULDBLOCK if the lock is currently held by another thread. |
0 | On success. |
int rlock_unlock | ( | recursive_lock_t * | l | ) |
Unlock a recursive lock.
l | The recursive lock to unlock. |
-1 | On error, errno will be set to EPERM if the lock is not held by the calling thread. |
0 | On success. |