|
CX Framework
Cross-platform C utility framework
|
Reader-writer lock synchronization primitive. More...
#include <cx/cx.h>#include <cx/meta/block.h>#include <cx/platform/base.h>#include "aspin.h"#include "futex.h"Go to the source code of this file.
Data Structures | |
| struct | RWLock |
Macros | |
| #define | RWLOCK_READER_MAX 4095 |
| Maximum number of concurrent readers. | |
| #define | RWLOCK_READWAIT_MAX 2047 |
| Maximum number of waiting readers. | |
| #define | RWLOCK_WRITER_MAX 511 |
| Maximum number of writers (active + pending) | |
| #define | rwlockInit(l, ...) _rwlockInit(l, opt_flags(__VA_ARGS__)) |
| #define | withReadLock(l) blkWrap (rwlockAcquireRead(l), rwlockReleaseRead(l)) |
| #define | withWriteLock(l) blkWrap (rwlockAcquireWrite(l), rwlockReleaseWrite(l)) |
Typedefs | |
| typedef struct RWLock | RWLock |
Enumerations | |
| enum | RWLOCK_Flags { RWLOCK_NoSpin = 1 } |
| Reader-writer lock initialization flags. More... | |
Functions | |
| bool | rwlockTryAcquireReadTimeout (RWLock *l, int64 timeout) |
| bool | rwlockTryAcquireWriteTimeout (RWLock *l, int64 timeout) |
| bool | rwlockTryAcquireRead (RWLock *l) |
| bool | rwlockTryAcquireWrite (RWLock *l) |
| void | rwlockAcquireRead (RWLock *l) |
| void | rwlockAcquireWrite (RWLock *l) |
| bool | rwlockReleaseRead (RWLock *l) |
| bool | rwlockReleaseWrite (RWLock *l) |
| bool | rwlockDowngradeWrite (RWLock *l) |
| void | rwlockDestroy (RWLock *l) |
Reader-writer lock synchronization primitive.
Definition in file rwlock.h.