Nebula
|
#include <linuxthreadlocaldata.h>
Thread local data storage class for platforms which don't have a proper __thread implementation but a pthread implementation.
(C) 2011 A.Weissflog (C) 2013-2018 Individual contributors, see AUTHORS file
Static Public Member Functions | |
static void | SetupMainThread () |
setup the object from the main thread (call from SysFunc::Setup()) | |
static IndexT | RegisterSlot () |
register a new slot, this is usually called from the main thread | |
static void | SetPointer (IndexT slot, void *ptr) |
set thread local pointer value (must only be called once) | |
static void * | GetPointer (IndexT slot) |
get thread local pointer value | |
static void | ClearPointer (IndexT slot) |
clear pointer (must only be called after SetPointer) | |
Static Private Member Functions | |
static void ** | GetThreadLocalTable () |
get pointer to thread locale data table, create table if this is the first call for this thread | |
Static Private Attributes | |
static const int | MaxNumSlots = 4096 |
static pthread_key_t | key = 0 |
static IndexT volatile | slot = 0 |
|
static |
clear pointer (must only be called after SetPointer)
Clear thread-local pointer for a slot.
|
static |
get thread local pointer value
Get a thread-local pointer for a slot.
|
staticprivate |
get pointer to thread locale data table, create table if this is the first call for this thread
Allocates a new thread-specific data block and sets it as thread-local data.
This is called from SetPointer(), GetPointer() and the other accessor functions.
|
static |
register a new slot, this is usually called from the main thread
Register a new slot in the thread-locale table.
This is usually called once from the main-thread per thread-local object.
|
static |
set thread local pointer value (must only be called once)
Set a thread-local pointer for a slot.
This method must only be called once per thread.
|
static |
setup the object from the main thread (call from SysFunc::Setup())
This method must be called once from the main thread (usually from SysFunc::Setup().
|
staticprivate |
|
staticprivate |
|
staticprivate |