nn::os::ThreadLocalStorage Class

Header file: nn/os.h

Syntax

class ThreadLocalStorage

Description

Class that represents thread-local storage with the same size as the uptr type.

Thread-local storage comprises a fixed number of uptr slots that are reserved by the constructor. In the present implementation, up to 16 slots can be secured at the same time.

Data stored in thread-local storage can be obtained and set using the GetValue and SetValue functions, respectively.

When a thread is created, its entire thread-local storage region is initialized to 0.

Member Functions

ThreadLocalStorage Creates a thread-local storage object and allocates one slot.
~ThreadLocalStorage Frees the slots of a thread-local storage object and destroys the object.
GetValue Gets a value stored in thread-local storage.
SetValue Sets a value to store in thread-local storage.

Revision History

2011/06/22
Added mention of the maximum number of slots that can be secured.
2010/01/07
Initial version.

CONFIDENTIAL