diff options
author | Chris Robinson <[email protected]> | 2014-05-10 05:07:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-05-10 05:07:13 -0700 |
commit | a45570414847a359fab317e2ff4929c41a4af431 (patch) | |
tree | 9473e57c11708107ac5aafd3adbfd284d1f95d91 /OpenAL32/alState.c | |
parent | eebde08e65ea8f2c3200308d8db1e031a0d80273 (diff) |
Use a RWLock to help protect the source's buffer queue
In some instances this allows to to remove the device/mixer lock, or reduce how
long it's held.
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index c6deda46..d499fcd1 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -784,7 +784,11 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) && Source->Offset >= 0.0) + { + ReadLock(&Source->queue_lock); ApplyOffset(Source); + ReadUnlock(&Source->queue_lock); + } new_state = ExchangeInt(&Source->new_state, AL_NONE); if(new_state) |