Table of Contents


qthread_worker - returns the qthread’s current worker ID


#include <qthread.h>

qthread_worker (qthread_shepherd_id_t *shep);


This function returns the ID of the worker that the current thread is executing on. If shep is non-NULL, the value of the current shepherd identifier is written to that location.

Note that the current worker ID is transient, and is likely to change, for example, after a call to qthread_yield(). This value is dependent on how many workers are currently active.

Return Value

This function either returns the ID number of the current worker of the calling function, or returns NO_WORKER.

See Also

pthread_getspecific(3) , qthread_retloc(3) , pthread_shep(3) , qthread_stackleft(3) , qthread_id(3)

Table of Contents