Author: hpoussin
Date: Fri Nov 16 16:16:43 2007
New Revision: 30501
URL:
http://svn.reactos.org/svn/reactos?rev=30501&view=rev
Log:
Fix race condition
Modified:
trunk/reactos/dll/win32/advapi32/sec/misc.c
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c Fri Nov 16 16:16:43 2007
@@ -69,7 +69,9 @@
{
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 */