Table of Contents

Name

qthread_id - returns the qthread’s unique ID number

Synopsis

#include <qthread.h>

unsigned int
qthread_id (void);

Description

This function returns the unique identifier associated with the qthread me. This is used mostly for debugging, as obtaining a global identifier requires synchronization. Unless otherwise configured, the qthread library assigns thread ids only when they are asked for. Generally they are monotonically increasing values, but the value can wrap around after UINT_MAX-2 threads.

Return Value

On success, the thread’s identifying number is returned. If called from outside the Qthreads library, QTHREAD_NON_TASK_ID is returned. The special value QTHREAD_NULL_TASK_ID will never be returned.

See Also

qthread_retloc(3) , qthread_shep(3) , qthread_stackleft(3)


Table of Contents