Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
linuxthreadlocaldata.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
12
#include "
core/types.h
"
13
14
//------------------------------------------------------------------------------
15
namespace
Linux
16
{
17
class
LinuxThreadLocalData
18
{
19
public
:
21
static
void
SetupMainThread
();
22
24
static
IndexT
RegisterSlot
();
26
static
void
SetPointer
(
IndexT
slot
,
void
* ptr);
28
static
void
*
GetPointer
(
IndexT
slot
);
30
static
void
ClearPointer
(
IndexT
slot
);
31
32
private
:
34
static
void
**
GetThreadLocalTable
();
35
36
static
const
int
MaxNumSlots
= 4096;
37
static
pthread_key_t
key
;
38
static
IndexT
volatile
slot
;
39
};
40
41
}
// namespace Linux
42
//------------------------------------------------------------------------------
Linux::LinuxThreadLocalData
Thread local data storage class for platforms which don't have a proper __thread implementation but a...
Definition
linuxthreadlocaldata.h:18
Linux::LinuxThreadLocalData::GetPointer
static void * GetPointer(IndexT slot)
get thread local pointer value
Definition
linuxthreadlocaldata.cc:89
Linux::LinuxThreadLocalData::key
static pthread_key_t key
Definition
linuxthreadlocaldata.h:37
Linux::LinuxThreadLocalData::RegisterSlot
static IndexT RegisterSlot()
register a new slot, this is usually called from the main thread
Definition
linuxthreadlocaldata.cc:64
Linux::LinuxThreadLocalData::SetupMainThread
static void SetupMainThread()
setup the object from the main thread (call from SysFunc::Setup())
Definition
linuxthreadlocaldata.cc:47
Linux::LinuxThreadLocalData::slot
static IndexT volatile slot
Definition
linuxthreadlocaldata.h:38
Linux::LinuxThreadLocalData::SetPointer
static void SetPointer(IndexT slot, void *ptr)
set thread local pointer value (must only be called once)
Definition
linuxthreadlocaldata.cc:76
Linux::LinuxThreadLocalData::ClearPointer
static void ClearPointer(IndexT slot)
clear pointer (must only be called after SetPointer)
Definition
linuxthreadlocaldata.cc:101
Linux::LinuxThreadLocalData::MaxNumSlots
static const int MaxNumSlots
Definition
linuxthreadlocaldata.h:36
Linux::LinuxThreadLocalData::GetThreadLocalTable
static void ** GetThreadLocalTable()
get pointer to thread locale data table, create table if this is the first call for this thread
Definition
linuxthreadlocaldata.cc:22
Linux
Definition
linuxcompletioncounter.h:15
types.h
IndexT
int IndexT
Definition
types.h:41
code
foundation
threading
linux
linuxthreadlocaldata.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.