diff options
author | Chris Robinson <[email protected]> | 2011-08-29 19:44:40 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-29 20:05:50 -0700 |
commit | 8eaa9bb4691dbd479236771064b958bedcdab145 (patch) | |
tree | 514f8630df3deab4e23301eb7dea46b11e4858ba /OpenAL32 | |
parent | b283dd3682e5c56483e69c4b65e889563e95d8c0 (diff) |
Manually lock the map while iterating through its contents
Diffstat (limited to 'OpenAL32')
-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 841f6f31..424a73f6 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -610,12 +610,14 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) src++; } + ReadLock(&Context->EffectSlotMap.lock); for(e = 0;e < Context->EffectSlotMap.size;e++) { ALEffectSlot = Context->EffectSlotMap.array[e].value; if(Exchange_ALenum(&ALEffectSlot->NeedsUpdate, AL_FALSE)) ALEffect_Update(ALEffectSlot->EffectState, Context, ALEffectSlot); } + ReadUnlock(&Context->EffectSlotMap.lock); UnlockContext(Context); } @@ -634,6 +636,7 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) ALsizei pos; LockContext(Context); + ReadLock(&Context->SourceMap.lock); for(pos = 0;pos < Context->SourceMap.size;pos++) { ALsource *Source = Context->SourceMap.array[pos].value; @@ -646,6 +649,7 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) if(new_state) SetSourceState(Source, Context, new_state); } + ReadUnlock(&Context->SourceMap.lock); UnlockContext(Context); } |