Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Class that supports TBB initialization. More...
#include <tbb_main.h>
Public Member Functions | |
__TBB_InitOnce () | |
Add initial reference to resources. More... | |
~__TBB_InitOnce () | |
Remove the initial reference to resources. More... | |
Static Public Member Functions | |
static void | lock () |
static void | unlock () |
static bool | initialization_done () |
static void | add_ref () |
Add reference to resources. If first reference added, acquire the resources. More... | |
static void | remove_ref () |
Remove reference to resources. If last reference removed, release the resources. More... | |
Static Private Member Functions | |
static void | acquire_resources () |
Platform specific code to acquire resources. More... | |
static void | release_resources () |
Platform specific code to release resources. More... | |
Static Private Attributes | |
static atomic< int > | count |
Counter of references to global shared resources such as TLS. More... | |
static bool | InitializationDone |
Specifies if the one-time initializations has been done. More... | |
static __TBB_atomic_flag | InitializationLock |
Global initialization lock. More... | |
Friends | |
void | DoOneTimeInitializations () |
Performs thread-safe lazy one-time general TBB initialization. More... | |
void | ITT_DoUnsafeOneTimeInitialization () |
Class that supports TBB initialization.
It handles acquisition and release of global resources (e.g. TLS) during startup and shutdown, as well as synchronization for DoOneTimeInitializations.
Definition at line 37 of file tbb_main.h.
|
inline |
Add initial reference to resources.
We assume that dynamic loading of the library prevents any other threads from entering the library until this constructor has finished running.
Definition at line 69 of file tbb_main.h.
References add_ref().
|
inline |
Remove the initial reference to resources.
This is not necessarily the last reference if other threads are still running.
Definition at line 73 of file tbb_main.h.
References initialization_done(), remove_ref(), and tbb::internal::governor::terminate_auto_initialized_scheduler().
|
staticprivate |
Platform specific code to acquire resources.
|
static |
Add reference to resources. If first reference added, acquire the resources.
Definition at line 117 of file tbb_main.cpp.
References tbb::internal::governor::acquire_resources(), and count.
Referenced by __TBB_InitOnce(), tbb::internal::DoOneTimeInitializations(), and tbb::internal::market::global_market().
|
inlinestatic |
Definition at line 64 of file tbb_main.h.
References tbb::internal::__TBB_load_with_acquire(), and InitializationDone.
Referenced by tbb::internal::governor::one_time_init(), tbb::internal::governor::release_resources(), and ~__TBB_InitOnce().
|
inlinestatic |
Definition at line 60 of file tbb_main.h.
References __TBB_LockByte(), and InitializationLock.
Referenced by tbb::internal::DoOneTimeInitializations().
|
staticprivate |
Platform specific code to release resources.
|
static |
Remove reference to resources. If last reference removed, release the resources.
Definition at line 122 of file tbb_main.cpp.
References __TBB_ASSERT, count, ITT_FINI_ITTLIB, and tbb::internal::governor::release_resources().
Referenced by tbb::internal::market::destroy(), and ~__TBB_InitOnce().
|
inlinestatic |
Definition at line 62 of file tbb_main.h.
References __TBB_UnlockByte, and InitializationLock.
Referenced by tbb::internal::DoOneTimeInitializations().
|
friend |
Performs thread-safe lazy one-time general TBB initialization.
Definition at line 215 of file tbb_main.cpp.
|
friend |
|
staticprivate |
Counter of references to global shared resources such as TLS.
Definition at line 41 of file tbb_main.h.
Referenced by add_ref(), and remove_ref().
|
staticprivate |
Specifies if the one-time initializations has been done.
Flag that is set to true after one-time initializations are done.
Definition at line 50 of file tbb_main.h.
Referenced by tbb::internal::DoOneTimeInitializations(), and initialization_done().
|
staticprivate |
Global initialization lock.
Scenarios are possible when tools interop has to be initialized before the TBB itself. This imposes a requirement that the global initialization lock has to support valid static initialization, and does not issue any tool notifications in any build mode.
Definition at line 57 of file tbb_main.h.