#include <Inventor/SbBase.h>
#include <Inventor/STL/vector>
#include <Inventor/threads/SbThreadSpinlock.h>
#include <Inventor/errors/SoDebugError.h>
Go to the source code of this file.
Classes | |
class | SbThreadLocalStorage |
Thread Local Storage (TLS) class. More... | |
class | SbThreadLocalStorage::StorageInfo |
Defines | |
#define | SB_THREAD_INIT_CLASS(_className_, _structName_) |
#define | SB_THREAD_EXIT_CLASS(_className_) |
#define | GET_THREAD_LOCAL_VAR(_className_, _structName_, _varName_) |
#define | GET_THREAD_LOCAL_STORAGE(_className_) |
#define | SB_THREAD_TLS_HEADER() |
#define | SB_THREAD_TLS_SOURCE(_className_) |
#define | SoNodeTLS 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.
#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 SB_THREAD_EXIT_CLASS | ( | _className_ | ) |
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
#define SB_THREAD_INIT_CLASS | ( | _className_, | |||
_structName_ | ) |
if ( _className_::MT_Id == -1 ) \ _className_::MT_Id = SbThreadLocalStorage::createStorage(sizeof(struct _className_::_structName_), _className_::initTLSClass, _className_::exitTLSClass, __FUNCTION__ ); \ else \ SoDebugError::post(__FUNCTION__,"SB_THREAD_INIT_CLASS called multiple time for class " SO__QUOTE(_className_));
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
#define SB_THREAD_TLS_HEADER | ( | ) |
private: \ \ static size_t MT_Id; \ \ static void initTLSClass(); \ \ static void exitTLSClass()
Defines headers for required member variables in thread storage management.
#define SB_THREAD_TLS_SOURCE | ( | _className_ | ) |
\ \ size_t _className_::MT_Id = -1
TLS storage unique id.
TLS storage initialization method TLS storage cleanup method Defines source for required member variables in thread storage management.
#define SoNodeTLS SbThreadLocalStorage |
Unique Id to reference access TLS data associated to this class through getStorage method.
Compatiblity define SoNodeTLS to SbThreadLocalStorage.
typedef void SoExitTLSClassCB() |
typedef void SoInitTLSClassCB() |