Table of Contents
qthread_readFF - waits for the source to be full, then copies it
#include
<qthread/qthread.h>
int
qthread_readFF(qthread_t *me, aligned_t *dest, const aligned_t *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 semantics of
readFF are:
1 - src’s FEB state must be "full"
2 - data is copied from src to dest
This function takes a qthread_t pointer
as an argument (me), which is supposed to point to the qthread_t relating
to the currently executing qthread. If me is NULL, the current qthread will
be discovered using qthread_self().
This, and all other FEB-related
functions currently operate exclusively on aligned data. This is to simulate
the behavior of the MTA as closely as possible. The library requires 4-byte
alignment.
On success, the memory address src is marked full,
the address dest is filled with the contents of src and 0 is returned. On
error, an 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_readFE(3)
,
qthread_lock(3)
, qthread_unlock(3)
Table of Contents