Table of Contents

Name

qthread_self - retrieve the qthread_t pointer for the current thread

Synopsis

#include <qthread/qthread.h>

qthread_t *
qthread_self(void);

Description

This function allows a qthread to retrieve its qthread_t pointer.

This often relies on pthread_getspecific(), which may be slow. On some architectures may cause a context-switch into the kernel.

Return Value

qthread_self() will return either a pointer to the qthread_t structure associated with the calling qthread, or if called from a non-qthread (i.e. a pthread or before qthread_init() has been called), will return NULL.

See Also

qthread_id(3) , qthread_shep(3)


Table of Contents