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).
This commit is contained in:
Chris Robinson
2008-02-06 22:22:29 -08:00
parent b4ffdfab81
commit 081e593e2b
+2 -1
View File
@@ -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 ||