#include <Inventor/SbBase.h>
Go to the source code of this file.
Classes | |
class | SbThreadLocalStorage |
Thread Local Storage (TLS) class. More... | |
Macros | |
#define | SB_THREAD_INIT_CLASS(_className_, _structName_) SbThreadLocalStorage::createStorage(_className_::MT_Id, sizeof(struct _className_::_structName_), _className_::initTLSClass, _className_::exitTLSClass, OIV_FUNCTION ); |
Requests allocation of thread local storage. | |
#define | SB_THREAD_IS_INITIALIZED(_className_) SbThreadLocalStorage::isInitialized(_className_::MT_Id) |
Returns true if a TLS storage has been allocated for the given classThreadId. | |
#define | SB_THREAD_EXIT_CLASS(_className_) SbThreadLocalStorage::deleteStorage( _className_::MT_Id, OIV_FUNCTION ); |
Requests deallocation of thread local storage. | |
#define | GET_THREAD_LOCAL_VAR(_className_, _structName_, _varName_) ((static_cast<struct _className_::_structName_ *> (SbThreadLocalStorage::getStorage(_className_::MT_Id)))->_varName_) |
Gets direct access to current thread storage inside variable. | |
#define | GET_THREAD_LOCAL_STORAGE(_className_) (static_cast<void *> (SbThreadLocalStorage::getStorage(_className_::MT_Id))) |
Returns pointer to current thread storage for defined class. | |
#define | SB_THREAD_TLS_HEADER() |
Defines headers for required member variables in thread storage management. | |
#define | SB_THREAD_TLS_SOURCE(_className_) |
Defines source for required member variables in thread storage management. | |
#define | SoNodeTLS SbThreadLocalStorage |
Compatiblity define SoNodeTLS to SbThreadLocalStorage. | |
Typedefs | |
typedef void | SoInitTLSClassCB() |
typedef void | SoExitTLSClassCB() |
#define GET_THREAD_LOCAL_STORAGE | ( | _className_ | ) | (static_cast<void *> (SbThreadLocalStorage::getStorage(_className_::MT_Id))) |
Returns pointer to current thread storage for defined class.
Definition at line 69 of file SbThreadLocalStorage.h.
#define GET_THREAD_LOCAL_VAR | ( | _className_, | |
_structName_, | |||
_varName_ | |||
) | ((static_cast<struct _className_::_structName_ *> (SbThreadLocalStorage::getStorage(_className_::MT_Id)))->_varName_) |
Gets direct access to current thread storage inside variable.
Definition at line 63 of file SbThreadLocalStorage.h.
#define SB_THREAD_EXIT_CLASS | ( | _className_ | ) | SbThreadLocalStorage::deleteStorage( _className_::MT_Id, OIV_FUNCTION ); |
Requests deallocation of thread local storage.
This macro should be called within exitClass(). The structName argument should be the structure (the type name) defining what size of memory should be allocated for each thread, for this class
Definition at line 57 of file SbThreadLocalStorage.h.
#define SB_THREAD_INIT_CLASS | ( | _className_, | |
_structName_ | |||
) | SbThreadLocalStorage::createStorage(_className_::MT_Id, sizeof(struct _className_::_structName_), _className_::initTLSClass, _className_::exitTLSClass, OIV_FUNCTION ); |
Requests allocation of thread local storage.
This macro should be called within initClass(). The structName argument should be the structure (the type name) defining what size of memory should be allocated for each thread, for this class
Definition at line 39 of file SbThreadLocalStorage.h.
#define SB_THREAD_IS_INITIALIZED | ( | _className_ | ) | SbThreadLocalStorage::isInitialized(_className_::MT_Id) |
Returns true if a TLS storage has been allocated for the given classThreadId.
This MACRO is used in exitTLSClass() implementation to avoid calling getStorage() which will create the TLS if not found, which is useless as the purpose of exitTLSClass() is to delete associated resources.
Definition at line 48 of file SbThreadLocalStorage.h.
#define SB_THREAD_TLS_HEADER | ( | ) |
Defines headers for required member variables in thread storage management.
Definition at line 75 of file SbThreadLocalStorage.h.
#define SB_THREAD_TLS_SOURCE | ( | _className_ | ) |
Defines source for required member variables in thread storage management.
Definition at line 88 of file SbThreadLocalStorage.h.
#define SoNodeTLS SbThreadLocalStorage |
Compatiblity define SoNodeTLS to SbThreadLocalStorage.
Definition at line 94 of file SbThreadLocalStorage.h.
typedef void SoExitTLSClassCB() |
Definition at line 31 of file SbThreadLocalStorage.h.
typedef void SoInitTLSClassCB() |
Definition at line 30 of file SbThreadLocalStorage.h.