Table of Contents


qthread_syncvar_readFF - waits for the syncvar to be full, then copies its data


#include <qthread.h>

qthread_syncvar_readFF (uint64_t * restrict dest, syncvar_t * restrict src);


This function waits for memory to become full, and then reads it and leaves the memory as full. When memory becomes full, all threads waiting for it to become full with a readFF will receive the value at once and will be queued to run. Data is read from src and stored in dest. The dest may be NULL, in which case the data will not be copied.

The semantics of readFF are:

1 - src’s FEB state must be "full"
2 - data is copied from src to dest

Return Value

On success, the memory address src is marked full, the address dest is filled with the contents of src and 0 (QTHREAD_SUCCESS) is returned. On error, an non-zero error code is returned.


Not enough memory could be allocated for bookkeeping structures. QTHREAD_TIMEOUT Could not obtain the lock on the syncvar_t’s status bits. This may be caused by many things, including memory corruption, invalid syncvar, or even absurdly excessive contention (because its protected by a naive spinlock rather than a fair spinlock).

See Also

qthread_syncvar_empty(3) , qthread_syncvar_fill(3) , qthread_syncvar_writeFE(3) , qthread_syncvar_writeF(3) , qthread_syncvar_readFE(3) , qthread_syncvar_status(3)

Table of Contents