From 081e593e2b3caf86c7dfb8fa90485c309258ea0d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 6 Feb 2008 22:22:29 -0800 Subject: [PATCH] Set the done flag immediately when entering the initialization To prevent two threads from initializing at the same time (not that it's likely to happen at this point). --- Alc/ALc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index a21b90db..5aaa5b3c 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -203,6 +203,8 @@ static void InitAL(void) int i; const char *devs, *str; + done = 1; + InitializeCriticalSection(&_alMutex); ALTHUNK_INIT(); ReadALConfig(); @@ -249,7 +251,6 @@ static void InitAL(void) for(i = 0;BackendList[i].Init;i++) BackendList[i].Init(&BackendList[i].Funcs); - done = 1; str = GetConfigValue(NULL, "stereodup", "false"); DuplicateStereo = (strcasecmp(str, "true") == 0 || -- 2.11.4.GIT