|
ObjFW
|
#include "objfw-defs.h"#include <errno.h>#include "platform.h"import "macros.h"#include <pthread.h>import "OFAtomic.h"#include <sched.h>Go to the source code of this file.
Functions | |
| int | OFPlainMutexNew (OFPlainMutex *mutex) |
| Creates a new plain mutex. | |
| int | OFPlainMutexLock (OFPlainMutex *mutex) |
| Locks the specified mutex. | |
| int | OFPlainMutexTryLock (OFPlainMutex *mutex) |
| Tries to lock the specified mutex without blocking. | |
| int | OFPlainMutexUnlock (OFPlainMutex *mutex) |
| Unlocks the specified mutex. | |
| int | OFPlainMutexFree (OFPlainMutex *mutex) |
| Destroys the specified mutex. | |
| int | OFPlainRecursiveMutexNew (OFPlainRecursiveMutex *rmutex) |
| Creates a new plain recursive mutex. | |
| int | OFPlainRecursiveMutexLock (OFPlainRecursiveMutex *rmutex) |
| Locks the specified recursive mutex. | |
| int | OFPlainRecursiveMutexTryLock (OFPlainRecursiveMutex *rmutex) |
| Tries to lock the specified recursive mutex without blocking. | |
| int | OFPlainRecursiveMutexUnlock (OFPlainRecursiveMutex *rmutex) |
| Unlocks the specified recursive mutex. | |
| int | OFPlainRecursiveMutexFree (OFPlainRecursiveMutex *rmutex) |
| Destroys the specified recursive mutex. | |
| static OF_INLINE void | OFYieldThread (void) |
| Yield the current thread, indicating to the OS that another thread should execute instead. | |
| static OF_INLINE int | OFSpinlockNew (OFSpinlock *spinlock) |
| Creates a new spinlock. | |
| static OF_INLINE int | OFSpinlockTryLock (OFSpinlock *spinlock) |
| Tries to lock a spinlock. | |
| static OF_INLINE int | OFSpinlockLock (OFSpinlock *spinlock) |
| Locks a spinlock. | |
| static OF_INLINE int | OFSpinlockUnlock (OFSpinlock *spinlock) |
| Unlocks a spinlock. | |
| static OF_INLINE int | OFSpinlockFree (OFSpinlock *spinlock) |
| Destroys a spinlock. | |
|
extern |
Destroys the specified mutex.
| mutex | A pointer to the mutex to destruct |
|
extern |
Locks the specified mutex.
| mutex | A pointer to the mutex to lock |
|
extern |
Creates a new plain mutex.
A plain mutex is similar to an OFMutex, but does not use exceptions and is just a lightweight wrapper around the system's mutex implementation.
| mutex | A pointer to the mutex to create |
|
extern |
Tries to lock the specified mutex without blocking.
| mutex | A pointer to the mutex to try to lock |
|
extern |
Unlocks the specified mutex.
| mutex | A pointer to the mutex to unlock |
|
extern |
Destroys the specified recursive mutex.
| rmutex | A pointer to the recursive mutex to destruct |
|
extern |
Locks the specified recursive mutex.
| rmutex | A pointer to the recursive mutex to lock |
|
extern |
Creates a new plain recursive mutex.
A plain recursive mutex is similar to an OFRecursiveMutex, but does not use exceptions and is just a lightweight wrapper around the system's recursive mutex implementation (or lacking that, a simple implementation of recursive mutexes via regular mutexes).
| rmutex | A pointer to the recursive mutex to create |
|
extern |
Tries to lock the specified recursive mutex without blocking.
| rmutex | A pointer to the recursive mutex to try to lock |
|
extern |
Unlocks the specified recursive mutex.
| rmutex | A pointer to the recursive mutex to unlock |
|
static |
Destroys a spinlock.
| spinlock | A pointer to the spinlock to destroy |
|
static |
Locks a spinlock.
| spinlock | A pointer to the spinlock to lock |
|
static |
Creates a new spinlock.
| spinlock | A pointer to the spinlock to create |
|
static |
Tries to lock a spinlock.
| spinlock | A pointer to the spinlock to try to lock |
|
static |
Unlocks a spinlock.
| spinlock | A pointer to the spinlock to unlock |