folly::getCurrentThreadID

Get a process-specific identifier for the current thread.

Synopsis

Declared in <folly/system/ThreadId.h>

uint64_t
getCurrentThreadID();

Description

The return value will uniquely identify the thread within the current process.

Note that the return value does not necessarily correspond to an operating system thread ID. The return value is also only unique within the current process: getCurrentThreadID() may return the same value for two concurrently running threads in separate processes.

The thread ID may be reused once the thread it corresponds to has been joined.

Return Value

A process-specific identifier for the current thread.