Table of Contents
qthread_empty, qthread_fill - sets the given address to either "empty"
or "full"
#include <qthread.h>
int
qthread_empty (const aligned_t *dest);
int
qthread_fill (const aligned_t *dest);
The qthread_empty() and
qthread_fill() functions assert the empty or full state of the given dest
addresses. They do not wait for the addresses to be in any particular state.
The me argument is used for memory pooling purposes. Memory is allocated
on a per-shepherd basis (to avoid needing to protect the memory pool), thus
it needs to know which shepherd it is currently on. HOWEVER, this argument
is merely an optimization; these functions CAN figure out which pools to
use without this information (i.e. if the me argument is NULL).
Note that
qthread_empty( addr )
is slightly faster than
qthread_empty( addr )
On success, the full/empty bits are modified and 0 is returned. On
error, an non-zero error code is returned.
- ENOMEM
- Not enough memory
could be allocated. This may be because a temporary thread needed to be
created, or because a management structure needed to be created.
qthread_writeF(3)
,
qthread_writeEF(3)
, qthread_readFF(3)
, qthread_readFE(3)
, qthread_lock(3)
,
qthread_unlock(3)
Table of Contents