aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-12-07 01:07:54 -0800
committerChris Robinson <[email protected]>2008-12-07 01:07:54 -0800
commit2ec0e48d064d5a98b543ab3844e0114f1c17b1ce (patch)
treec9312f5092044511b34d5db80be49315e24f9f0e
parent8b54d59b8c201c90da4ec45bf81d7a945b143d10 (diff)
Protect playback device opening with a mutex lock
-rw-r--r--Alc/ALc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 925e4867..7f393c7c 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1266,21 +1266,21 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
device->MaxNoOfSources = 256;
// Find a playback device to open
+ SuspendContext(NULL);
for(i = 0;BackendList[i].Init;i++)
{
device->Funcs = &BackendList[i].Funcs;
if(ALCdevice_OpenPlayback(device, deviceName))
{
- SuspendContext(NULL);
device->next = g_pDeviceList;
g_pDeviceList = device;
g_ulDeviceCount++;
- ProcessContext(NULL);
bDeviceFound = AL_TRUE;
break;
}
}
+ ProcessContext(NULL);
if (!bDeviceFound)
{