summaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-29 19:44:40 -0700
committerChris Robinson <[email protected]>2011-08-29 20:05:50 -0700
commit8eaa9bb4691dbd479236771064b958bedcdab145 (patch)
tree514f8630df3deab4e23301eb7dea46b11e4858ba /Alc/ALu.c
parentb283dd3682e5c56483e69c4b65e889563e95d8c0 (diff)
Manually lock the map while iterating through its contents
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b11a1c3a..7300a81e 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1123,6 +1123,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
ALsource *source;
ALsizei pos;
+ ReadLock(&Context->SourceMap.lock);
for(pos = 0;pos < Context->SourceMap.size;pos++)
{
source = Context->SourceMap.array[pos].value;
@@ -1134,6 +1135,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
source->position_fraction = 0;
}
}
+ ReadUnlock(&Context->SourceMap.lock);
Context = Context->next;
}