Add a boolean to specify if a device is headphones
[openal-soft.git] / include / rwlock.h
blob158a06708e9d0394f3eee45e1ca626060d3caaf5
1 #ifndef AL_RWLOCK_H
2 #define AL_RWLOCK_H
4 #include "bool.h"
5 #include "atomic.h"
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 typedef struct {
12 RefCount read_count;
13 RefCount write_count;
14 ATOMIC(int) read_lock;
15 ATOMIC(int) read_entry_lock;
16 ATOMIC(int) write_lock;
17 } RWLock;
18 #define RWLOCK_STATIC_INITIALIZE { ATOMIC_INIT_STATIC(0), ATOMIC_INIT_STATIC(0), \
19 ATOMIC_INIT_STATIC(false), ATOMIC_INIT_STATIC(false), \
20 ATOMIC_INIT_STATIC(false) }
22 void RWLockInit(RWLock *lock);
23 void ReadLock(RWLock *lock);
24 void ReadUnlock(RWLock *lock);
25 void WriteLock(RWLock *lock);
26 void WriteUnlock(RWLock *lock);
28 #ifdef __cplusplus
30 #endif
32 #endif /* AL_RWLOCK_H */