pthread_threadid_np3
Get the calling thread's unique id
Usage
#include <pthread.h>
int
pthread_threadid_np(pthread_t thread, uint64_t *thread_id);
Overview
The pthread_threadid_np() function stores the system-wide unique integral ID of thread in the location spedified by thread_id. If thread is NULL, the ID of the current thread is provided.
Return values
If successful, the pthread_threadid_np() function will return zero. Otherwise an error number will be returned to indicate the error.
Errors
The pthread_threadid_np() function will fail if:
- [EINVAL]
-
NULL value for thread_id.
- [ESRCH]
-
Non-existent thread thread.
Releases
Unchanged in 66 releases since macOS 10.12.