dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
thread_id.h File Reference

Go to the source code of this file.

Functions

uint64_t dispenso::threadId ()
 

Detailed Description

Utilities for getting a unique thread identifier.

Definition in file thread_id.h.

Function Documentation

◆ threadId()

DISPENSO_DLL_ACCESS uint64_t dispenso::threadId ( )

Get the current thread's identifier, unique within the current process.

Returns
An integer representing the current thread.
Note
Thread IDs are assumed to not be reused over the lifetime of a process, but this should still enable processes running for thousands of years, even with very poor spawn/kill thread patterns.
If thread ID is needed for cross-process synchronization, one must fall back on system-specific thread IDs.

Definition at line 16 of file thread_id.cpp.