21 #ifndef __TBB_mutex_padding_H 22 #define __TBB_mutex_padding_H 29 namespace interface7 {
38 template<
typename Mutex>
41 pad_type my_pad[((
sizeof(Mutex)+cache_line_size-1)/cache_line_size+1)*cache_line_size/
sizeof(
pad_type)];
43 Mutex *
impl() {
return (Mutex *)((uintptr_t(
this)|(cache_line_size-1))+1);}
46 static const bool is_rw_mutex = Mutex::is_rw_mutex;
47 static const bool is_recursive_mutex = Mutex::is_recursive_mutex;
48 static const bool is_fair_mutex = Mutex::is_fair_mutex;
63 void release() { my_scoped_lock.release(); }
67 template<
typename Mutex>
75 static const bool is_rw_mutex = Mutex::is_rw_mutex;
76 static const bool is_recursive_mutex = Mutex::is_recursive_mutex;
77 static const bool is_fair_mutex = Mutex::is_fair_mutex;
94 void release() { my_scoped_lock.release(); }
static const size_t cache_line_size
bool try_acquire(padded_mutex &m, bool write=true)
void acquire(padded_mutex &m, bool write=true)
bool try_acquire(padded_mutex &m)
bool downgrade_to_reader()
scoped_lock(padded_mutex &m)
Mutex::scoped_lock my_scoped_lock
Mutex::scoped_lock my_scoped_lock
Base class for types that should not be copied or assigned.
scoped_lock(padded_mutex &m, bool write=true)
void acquire(padded_mutex &m)