Data Structures | |
struct | picotm_rwlock |
A reader-writer lock. More... | |
Macros | |
#define | PICOTM_RWLOCK_INITIALIZER |
Initializer macro for R/W state variables. | |
Functions | |
PICOTM_NOTHROW void | picotm_rwlock_init (struct picotm_rwlock *self) |
PICOTM_NOTHROW void | picotm_rwlock_try_rdlock (struct picotm_rwlock *self, struct picotm_error *error) |
PICOTM_NOTHROW void | picotm_rwlock_try_wrlock (struct picotm_rwlock *self, bool upgrade, struct picotm_error *error) |
PICOTM_NOTHROW void | picotm_rwlock_uninit (struct picotm_rwlock *self) |
PICOTM_NOTHROW void | picotm_rwlock_unlock (struct picotm_rwlock *self) |
PICOTM_NOTHROW void picotm_rwlock_init | ( | struct picotm_rwlock * | self | ) |
Initializes a reader-writer lock.
self | The reader-writer lock to initialize. |
PICOTM_NOTHROW void picotm_rwlock_try_rdlock | ( | struct picotm_rwlock * | self, |
struct picotm_error * | error | ||
) |
Tries to acquire a read lock. If the lock could not be acquired, the error parameter will return a conflict.
self | The reader lock to acquire. | |
[out] | error | Returns a error. |
PICOTM_NOTHROW void picotm_rwlock_try_wrlock | ( | struct picotm_rwlock * | self, |
bool | upgrade, | ||
struct picotm_error * | error | ||
) |
Tries to acquire a writer lock or upgrade an acquired reader lock to a writer lock. If the lock could not be acquired, the error parameter will return a conflict.
self | The writer lock to acquire. | |
upgrade | True to upgrade a previously acquired reader lock. | |
[out] | error | Returns a error. |
PICOTM_NOTHROW void picotm_rwlock_uninit | ( | struct picotm_rwlock * | self | ) |
Uninitializes a reader-writer lock.
self | The reader-writer lock to uninitialize. |
PICOTM_NOTHROW void picotm_rwlock_unlock | ( | struct picotm_rwlock * | self | ) |
Releases a reader-writer lock.
self | The reader-writer lock to release. |