aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-31 01:00:19 -0700
committerChris Robinson <[email protected]>2011-08-31 01:00:19 -0700
commitdd747573191938c9721945ac455d325d39d64fd2 (patch)
tree7cc22884334ae00dc1a5f2256b8dbcfe4618a1f6 /OpenAL32
parentab0b5d98902665603384f7744dd759cd33db007f (diff)
Add a function to initialize a RWLock
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h1
-rw-r--r--OpenAL32/alThunk.c6
2 files changed, 2 insertions, 5 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 1e4d3d61..564730c4 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -321,6 +321,7 @@ typedef struct {
volatile ALenum write_lock;
} RWLock;
+void RWLockInit(RWLock *lock);
void ReadLock(RWLock *lock);
void ReadUnlock(RWLock *lock);
void WriteLock(RWLock *lock);
diff --git a/OpenAL32/alThunk.c b/OpenAL32/alThunk.c
index 5784a358..7cd83c23 100644
--- a/OpenAL32/alThunk.c
+++ b/OpenAL32/alThunk.c
@@ -32,11 +32,7 @@ static RWLock ThunkLock;
void ThunkInit(void)
{
- ThunkLock.read_count = 0;
- ThunkLock.write_count = 0;
- ThunkLock.read_lock = AL_FALSE;
- ThunkLock.read_entry_lock = AL_FALSE;
- ThunkLock.write_lock = AL_FALSE;
+ RWLockInit(&ThunkLock);
ThunkArraySize = 1;
ThunkArray = calloc(1, ThunkArraySize * sizeof(*ThunkArray));
}