ezEngine  Milestone 7
ezThreadLocalStorage Struct Reference

Collection of basic methods for interaction with thread local storage. More...

#include <ThreadLocalStorage.h>

Static Public Member Functions

static ezUInt32 AllocateSlot ()
 Allocates a slot from the TLS variable pool. More...
 
static void FreeSlot (ezUInt32 uiSlotIndex)
 Frees a slot from the TLS variable pool.
 
static void SetValueForSlot (ezUInt32 uiSlotIndex, void *pValue)
 Sets the pointer value for the given slot.
 
static void * GetValueForSlot (ezUInt32 uiSlotIndex)
 Returns the pointer value stored in the given slot.
 
static bool IsValidSlot (ezUInt32 uiSlotIndex)
 Helper function to check if the given slot is a valid one.
 
static void SetPerThreadPointerTable (ezThreadLocalPointerTable *pPerThreadPointerTable)
 Sets the pointer to the per thread table used to handle an arbitrary amount of TLS variables. More...
 
static ezThreadLocalPointerTableGetPerThreadPointerTable ()
 Returns the per thread pointer table used to store TLS values internally.
 

Static Private Member Functions

static void Initialize ()
 Initialization functionality of the thread local storage system (called by foundation startup and thus private)
 
static void Shutdown ()
 Cleanup functionality of the thread local storage system (called by foundation shutdown and thus private)
 

Static Private Attributes

static bool s_bInitialized = false
 

Friends

class FoundationThreadUtilsSubSystem
 

Detailed Description

Collection of basic methods for interaction with thread local storage.

Member Function Documentation

ezUInt32 ezThreadLocalStorage::AllocateSlot ( )
static

Allocates a slot from the TLS variable pool.

Returns EZ_THREAD_LOCAL_STORAGE_INVALID_SLOT on failure (may also be checked with IsValidSlot()). Note that the preferred way of interaction is ezThreadLocal which encapsulates the logic to allocate and free TLS slots

void ezThreadLocalStorage::SetPerThreadPointerTable ( ezThreadLocalPointerTable pPerThreadPointerTable)
static

Sets the pointer to the per thread table used to handle an arbitrary amount of TLS variables.

Note
Note that all ezThread derived classes will set up this correctly before calling Run()

The documentation for this struct was generated from the following files: