Performs thread-safe lazy one-time general TBB initialization.
| 102 | |
| 103 | //! Performs thread-safe lazy one-time general TBB initialization. |
| 104 | void DoOneTimeInitialization() { |
| 105 | __TBB_InitOnce::lock(); |
| 106 | // No fence required for load of InitializationDone, because we are inside a critical section. |
| 107 | if( !__TBB_InitOnce::InitializationDone ) { |
| 108 | __TBB_InitOnce::add_ref(); |
| 109 | if( GetBoolEnvironmentVariable("TBB_VERSION") ) { |
| 110 | PrintVersion(); |
| 111 | tcm_adaptor::print_version(); |
| 112 | } |
| 113 | bool itt_present = false; |
| 114 | #if __TBB_USE_ITT_NOTIFY |
| 115 | ITT_DoUnsafeOneTimeInitialization(); |
| 116 | itt_present = ITT_Present; |
| 117 | #endif /* __TBB_USE_ITT_NOTIFY */ |
| 118 | initialize_cache_aligned_allocator(); |
| 119 | governor::initialize_rml_factory(); |
| 120 | // Force processor groups support detection |
| 121 | governor::default_num_threads(); |
| 122 | // Force OS regular page size detection |
| 123 | governor::default_page_size(); |
| 124 | PrintExtraVersionInfo( "TOOLS SUPPORT", itt_present ? "enabled" : "disabled" ); |
| 125 | __TBB_InitOnce::InitializationDone = true; |
| 126 | } |
| 127 | __TBB_InitOnce::unlock(); |
| 128 | } |
| 129 | |
| 130 | #if (_WIN32||_WIN64) && !__TBB_SOURCE_DIRECTLY_INCLUDED |
| 131 | //! Windows "DllMain" that handles startup and shutdown of dynamic library. |
no test coverage detected