Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ThreadPrivateBase Class Reference

Base class allowing an instance of an object to be stored per thread. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/concurrency/arccore/concurrency/ThreadPrivate.h>

Collaboration diagram for Arcane::ThreadPrivateBase:

Classes

class  ICreateFunctor

Public Member Functions

 ThreadPrivateBase (ThreadPrivateStorage *key, ICreateFunctor *create_functor)
void * item ()
 Retrieves the instance specific to the current thread.

Private Attributes

ThreadPrivateStoragem_key
GlibMutex m_mutex
ICreateFunctorm_create_functor

Detailed Description

Base class allowing an instance of an object to be stored per thread.

Deprecated
Use 'thread_local' from C++11.

Definition at line 75 of file ThreadPrivate.h.

Constructor & Destructor Documentation

◆ ThreadPrivateBase()

Arcane::ThreadPrivateBase::ThreadPrivateBase ( ThreadPrivateStorage * key,
ICreateFunctor * create_functor )
inline

Definition at line 90 of file ThreadPrivate.h.

◆ ~ThreadPrivateBase()

Arcane::ThreadPrivateBase::~ThreadPrivateBase ( )
inline

Definition at line 96 of file ThreadPrivate.h.

Member Function Documentation

◆ item()

void * Arcane::ThreadPrivateBase::item ( )

Retrieves the instance specific to the current thread.

If it does not yet exist, it is created via the functor passed as an argument to the constructor.

Warning
This method must not be called until the associated key (ThreadPrivateStorage) has been initialized by calling ThreadPrivateStorage::initialize().

Definition at line 60 of file ThreadPrivate.cc.

Member Data Documentation

◆ m_create_functor

ICreateFunctor* Arcane::ThreadPrivateBase::m_create_functor
private

Definition at line 118 of file ThreadPrivate.h.

◆ m_key

ThreadPrivateStorage* Arcane::ThreadPrivateBase::m_key
private

Definition at line 116 of file ThreadPrivate.h.

◆ m_mutex

GlibMutex Arcane::ThreadPrivateBase::m_mutex
private

Definition at line 117 of file ThreadPrivate.h.


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