Table of Contents

Name

qthread_writeF, qthread_writeF_const - fills an address with data

Synopsis

#include <qthread/qthread.h>

int
qthread_writeF(qthread_t *me, aligned_t *dest, const aligned_t *src);

int
qthread_writeF_const(qthread_t *me, aligned_t *dest, const aligned_t src);

Description

These functions are a cross between qthread_fill() and qthread_writeEF(). They do not wait for memory to become empty, but perform the write and set the state to full atomically (with respect to other FEB-based actions). Data is read from src and written to dest.

The semantics of writeF are:

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

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().

Warning

This, and all other FEB-related functions currently operate exclusively on aligned data.

Return Value

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

Errors

ENOMEM
Not enough memory could be allocated for bookkeeping structures.

See Also

qthread_empty(3) , qthread_fill(3) , qthread_writeEF(3) , qthread_readFF(3) , qthread_readFE(3) , qthread_lock(3) , qthread_unlock(3)


Table of Contents