nn::os::ManagedThread::GetCurrentId Member Function

Syntax

#include <nn/os.h>

static bit32 GetCurrentId();

Parameters

None.

Return Values

Returns the ID that uniquely identifies the current thread. When the current thread is not a thread created by ManagedThread, the function returns 0.

Description

Gets the ID that uniquely identifies the current thread.

This differs from the Thread::GetCurrentId function in that the value is cached in ThreadLocalStorage, so the ID can be obtained at a lower load.

When the current thread was not created by ManagedThread (for example, if it is a thread that was created by Thread), this function returns 0. Because 0 cannot be used as a valid ID, when this function returns 0 you can determine that the thread was not created by ManagedThread.

Revision History

2012/04/13
Initial version.

CONFIDENTIAL