ThreadCancellation.currentThreadId

ulong currentThreadId() static @property @safe @nogc nothrow

Returns the current thread's ID for use with cancellation functions.