11 #ifndef BOGUS_LOCK_HPP
12 #define BOGUS_LOCK_HPP
23 typedef omp_lock_t RawData ;
25 typedef void* RawData ;
32 unsigned char padding[24] ;
35 void (*set_f )(RawData*) ;
36 void (*unset_f)(RawData*) ;
39 if( set_f ) set_f( &data.api_type ) ;
43 if( unset_f ) unset_f( &data.api_type ) ;
57 for_abi_compat. set_f = 0 ;
58 for_abi_compat.unset_f = 0 ;
61 template<
bool DoLock = true >
72 template<
bool DoLock = true >
74 explicit Guard(
const Lock& lock )
77 if(DoLock) m_lock.set() ;
82 if(DoLock) m_lock.unset() ;
86 Guard(
const Guard &guard) ;
87 Guard& operator=(
const Guard &guard) ;
102 Lock& operator=(
const Lock& )
109 omp_destroy_lock( data() ) ;
120 lock_impl::RawData* data()
const {
121 return &m_impl.data.api_type ;
128 m_impl. set_f = &omp_set_lock ;
129 m_impl.unset_f = &omp_unset_lock ;
130 omp_init_lock( data() ) ;
133 lock_impl::AbstractLock m_impl ;