Table of Contents


qthread_worker_unique - returns the qthread’s current worker’s stable ID


#include <qthread.h>

qthread_worker_unique (qthread_shepherd_id_t *shep);


This function returns the stable 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 not dependent on how many workers have been disabled.

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