Safely insert the new context into the list

This commit is contained in:
Chris Robinson 2012-01-12 06:13:24 -08:00
parent c543611897
commit 530597347c

View File

@ -2205,8 +2205,9 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
ALCdevice_IncRef(device);
InitContext(ALContext);
ALContext->next = device->ContextList;
device->ContextList = ALContext;
do {
ALContext->next = device->ContextList;
} while(!CompExchangePtr((XchgPtr*)&device->ContextList, ALContext->next, ALContext));
UnlockLists();
ALCdevice_DecRef(device);