Fix race condition

svn path=/trunk/; revision=30501
This commit is contained in:
Hervé Poussineau 2007-11-16 13:16:43 +00:00
parent 910520b648
commit a5728dd37f

View file

@ -69,7 +69,9 @@ CheckNtMartaPresent(VOID)
{
DWORD ErrorCode;
if (NtMarta == NULL)
if (InterlockedCompareExchangePointer(&NtMarta,
NULL,
NULL) == NULL)
{
/* we're the first one trying to use ntmarta, initialize it and change
the pointer after initialization */