19#if !defined(__TBB_show_deprecation_message_critical_section_H) && defined(__TBB_show_deprecated_header_message)
20#define __TBB_show_deprecation_message_critical_section_H
21#pragma message("TBB Warning: tbb/critical_section.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")
24#if defined(__TBB_show_deprecated_header_message)
25#undef __TBB_show_deprecated_header_message
28#ifndef _TBB_CRITICAL_SECTION_H_
29#define _TBB_CRITICAL_SECTION_H_
31#define __TBB_critical_section_H_include_area
63 InitializeCriticalSectionEx( &
my_impl, 4000, 0 );
65 pthread_mutex_init(&
my_impl, NULL);
73 DeleteCriticalSection(&
my_impl);
75 pthread_mutex_destroy(&
my_impl);
96 EnterCriticalSection( &
my_impl );
98 int rval = pthread_mutex_lock(&
my_impl);
99 __TBB_ASSERT_EX(!rval,
"critical_section::lock: pthread_mutex_lock failed");
108 if(local_tid ==
my_tid)
return false;
110 gotlock = TryEnterCriticalSection( &
my_impl ) != 0;
112 int rval = pthread_mutex_trylock(&
my_impl);
114 __TBB_ASSERT(rval == 0 || rval == EBUSY,
"critical_section::trylock: pthread_mutex_trylock failed");
125 my_tid = tbb_thread::id();
127 LeaveCriticalSection( &
my_impl );
129 int rval = pthread_mutex_unlock(&
my_impl);
130 __TBB_ASSERT_EX(!rval,
"critical_section::unlock: pthread_mutex_unlock failed");
144#include "internal/_warning_suppress_disable_notice.h"
145#undef __TBB_critical_section_H_include_area
#define __TBB_DEPRECATED_IN_VERBOSE_MODE_MSG(msg)
#define __TBB_DEFINE_PROFILING_SET_NAME(sync_object_type)
#define __TBB_ASSERT_EX(predicate, comment)
"Extended" version is useful to suppress warnings if a variable is only used with an assert
#define __TBB_EXPORTED_METHOD
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
__TBB_DEPRECATED_IN_VERBOSE_MODE tbb_thread::id get_id()
static const bool is_fair_mutex
void __TBB_EXPORTED_METHOD internal_construct()
static const bool is_recursive_mutex
static const bool is_rw_mutex
scoped_lock(critical_section_v4 &lock_me)
critical_section_v4 & my_crit
Base class for types that should not be copied or assigned.