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

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

#include <arccore/concurrency/ThreadPrivate.h>

Classes

class  ICreateFunctor

Public Member Functions

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

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.


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