1#if !defined(PAPI_SDE_LIB_LOCK_H)
2#define PAPI_SDE_LIB_LOCK_H
5#if defined(AO_HAVE_test_and_set_acquire)
6#define USE_LIBAO_ATOMICS
12#if defined(USE_LIBAO_ATOMICS)
15#define sde_lock() {while (AO_test_and_set_acquire(&_sde_hwd_lock_data) != AO_TS_CLEAR) { ; } }
16#define sde_unlock() { AO_CLEAR(&_sde_hwd_lock_data); }
26 pthread_mutex_lock(&_sde_hwd_lock_data); \
29#define sde_unlock(lck) \
31 pthread_mutex_unlock(&_sde_hwd_lock_data); \
pthread_mutex_t _sde_hwd_lock_data