#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.
◆ OFPlainMutexFree()
int OFPlainMutexFree |
( |
OFPlainMutex * |
mutex | ) |
|
Destroys the specified mutex.
- Parameters
-
mutex | A pointer to the mutex to destruct |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainMutexLock()
int OFPlainMutexLock |
( |
OFPlainMutex * |
mutex | ) |
|
Locks the specified mutex.
- Parameters
-
mutex | A pointer to the mutex to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainMutexNew()
int OFPlainMutexNew |
( |
OFPlainMutex * |
mutex | ) |
|
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.
- Parameters
-
mutex | A pointer to the mutex to create |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainMutexTryLock()
int OFPlainMutexTryLock |
( |
OFPlainMutex * |
mutex | ) |
|
Tries to lock the specified mutex without blocking.
- Parameters
-
mutex | A pointer to the mutex to try to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainMutexUnlock()
int OFPlainMutexUnlock |
( |
OFPlainMutex * |
mutex | ) |
|
Unlocks the specified mutex.
- Parameters
-
mutex | A pointer to the mutex to unlock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainRecursiveMutexFree()
int OFPlainRecursiveMutexFree |
( |
OFPlainRecursiveMutex * |
rmutex | ) |
|
Destroys the specified recursive mutex.
- Parameters
-
rmutex | A pointer to the recursive mutex to destruct |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainRecursiveMutexLock()
int OFPlainRecursiveMutexLock |
( |
OFPlainRecursiveMutex * |
rmutex | ) |
|
Locks the specified recursive mutex.
- Parameters
-
rmutex | A pointer to the recursive mutex to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainRecursiveMutexNew()
int OFPlainRecursiveMutexNew |
( |
OFPlainRecursiveMutex * |
rmutex | ) |
|
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).
- Parameters
-
rmutex | A pointer to the recursive mutex to create |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainRecursiveMutexTryLock()
int OFPlainRecursiveMutexTryLock |
( |
OFPlainRecursiveMutex * |
rmutex | ) |
|
Tries to lock the specified recursive mutex without blocking.
- Parameters
-
rmutex | A pointer to the recursive mutex to try to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainRecursiveMutexUnlock()
int OFPlainRecursiveMutexUnlock |
( |
OFPlainRecursiveMutex * |
rmutex | ) |
|
Unlocks the specified recursive mutex.
- Parameters
-
rmutex | A pointer to the recursive mutex to unlock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSpinlockFree()
static OF_INLINE int OFSpinlockFree |
( |
OFSpinlock * |
spinlock | ) |
|
|
static |
Destroys a spinlock.
- Parameters
-
spinlock | A pointer to the spinlock to destroy |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSpinlockLock()
static OF_INLINE int OFSpinlockLock |
( |
OFSpinlock * |
spinlock | ) |
|
|
static |
Locks a spinlock.
- Parameters
-
spinlock | A pointer to the spinlock to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSpinlockNew()
static OF_INLINE int OFSpinlockNew |
( |
OFSpinlock * |
spinlock | ) |
|
|
static |
Creates a new spinlock.
- Parameters
-
spinlock | A pointer to the spinlock to create |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSpinlockTryLock()
static OF_INLINE int OFSpinlockTryLock |
( |
OFSpinlock * |
spinlock | ) |
|
|
static |
Tries to lock a spinlock.
- Parameters
-
spinlock | A pointer to the spinlock to try to lock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSpinlockUnlock()
static OF_INLINE int OFSpinlockUnlock |
( |
OFSpinlock * |
spinlock | ) |
|
|
static |
Unlocks a spinlock.
- Parameters
-
spinlock | A pointer to the spinlock to unlock |
- Returns
- 0 on success, or an error number from
<errno.h>
on error