17 #ifndef __TBB_mutex_padding_H 18 #define __TBB_mutex_padding_H 25 namespace interface7 {
34 template<
typename Mutex>
37 pad_type my_pad[((
sizeof(Mutex)+cache_line_size-1)/cache_line_size+1)*cache_line_size/
sizeof(
pad_type)];
39 Mutex *
impl() {
return (Mutex *)((uintptr_t(
this)|(cache_line_size-1))+1);}
42 static const bool is_rw_mutex = Mutex::is_rw_mutex;
43 static const bool is_recursive_mutex = Mutex::is_recursive_mutex;
44 static const bool is_fair_mutex = Mutex::is_fair_mutex;
59 void release() { my_scoped_lock.release(); }
63 template<
typename Mutex>
71 static const bool is_rw_mutex = Mutex::is_rw_mutex;
72 static const bool is_recursive_mutex = Mutex::is_recursive_mutex;
73 static const bool is_fair_mutex = Mutex::is_fair_mutex;
90 void release() { my_scoped_lock.release(); }
bool try_acquire(padded_mutex &m, bool write=true)
void acquire(padded_mutex &m)
scoped_lock(padded_mutex &m)
Base class for types that should not be copied or assigned.
scoped_lock(padded_mutex &m, bool write=true)
Mutex::scoped_lock my_scoped_lock
Mutex::scoped_lock my_scoped_lock
static const size_t cache_line_size
void acquire(padded_mutex &m, bool write=true)
bool try_acquire(padded_mutex &m)
bool downgrade_to_reader()