Table of Contents
qthread_lock, qthread_unlock - lock or unlock an address
#include
<qthread.h>
int
qthread_lock (aligned_t *addr);
int
qthread_unlock (aligned_t *addr);
These functions are designed
to implement FEB-like locking and unlocking that behaves much more like
a mutex.
These are atomic and functional, but do not have the same semantics
as full FEB locking/unlocking (namely, unlocking cannot block), however
because of this, they have lower overhead.
On success, the memory
address addr is marked locked or unlocked appropriately and 0 is returned.
If unlocking an address that is already unlocked, QTHREAD_REDUNDANT will
be returned. On error, a non-zero error code is returned.
- ENOMEM
- Not
enough memory could be allocated for bookkeeping structures.
qthread_empty(3)
,
qthread_fill(3)
, qthread_writeEF(3)
, qthread_writeF(3)
, qthread_readFF(3)
,
qthread_readFE(3)
Table of Contents