21 #ifndef _TBB_CRITICAL_SECTION_H_ 22 #define _TBB_CRITICAL_SECTION_H_ 29 #endif // _WIN32||WIN64 53 InitializeCriticalSectionEx( &
my_impl, 4000, 0 );
55 pthread_mutex_init(&
my_impl, NULL);
63 DeleteCriticalSection(&
my_impl);
65 pthread_mutex_destroy(&
my_impl);
86 EnterCriticalSection( &
my_impl );
88 int rval = pthread_mutex_lock(&
my_impl);
89 __TBB_ASSERT_EX(!rval,
"critical_section::lock: pthread_mutex_lock failed");
98 if(local_tid ==
my_tid)
return false;
100 gotlock = TryEnterCriticalSection( &
my_impl ) != 0;
102 int rval = pthread_mutex_trylock(&
my_impl);
104 __TBB_ASSERT(rval == 0 || rval == EBUSY,
"critical_section::trylock: pthread_mutex_trylock failed");
117 LeaveCriticalSection( &
my_impl );
119 int rval = pthread_mutex_unlock(&
my_impl);
120 __TBB_ASSERT_EX(!rval,
"critical_section::unlock: pthread_mutex_unlock failed");
133 #endif // _TBB_CRITICAL_SECTION_H_ critical_section_v4 & my_crit
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id id
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
scoped_lock(critical_section_v4 &lock_me)
#define __TBB_ASSERT_EX(predicate, comment)
"Extended" version is useful to suppress warnings if a variable is only used with an assert
static const bool is_rw_mutex
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
#define __TBB_EXPORTED_METHOD
void __TBB_EXPORTED_METHOD internal_construct()
#define __TBB_DEFINE_PROFILING_SET_NAME(sync_object_type)
static const bool is_recursive_mutex
static const bool is_fair_mutex
internal::critical_section_v4 critical_section