ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r369773 - /webservices/axis/trunk/c/src/engine/Axis.cpp
Date Tue, 17 Jan 2006 13:27:09 GMT
Author: dicka
Date: Tue Jan 17 05:27:00 2006
New Revision: 369773

URL: http://svn.apache.org/viewcvs?rev=369773&view=rev
Log:
Improve synchronization for Win32 as per AXISCPP-902

Modified:
    webservices/axis/trunk/c/src/engine/Axis.cpp

Modified: webservices/axis/trunk/c/src/engine/Axis.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/Axis.cpp?rev=369773&r1=369772&r2=369773&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/Axis.cpp (original)
+++ webservices/axis/trunk/c/src/engine/Axis.cpp Tue Jan 17 05:27:00 2006
@@ -308,17 +308,16 @@
 
 #ifdef WIN32
 
-static volatile long g_uModuleInitializing = 0; 
-static void start_initializing() 
-{ 
-    while (InterlockedIncrement((LONG*)&g_uModuleInitializing) != 1) { 
-        InterlockedDecrement((LONG*)&g_uModuleInitializing); 
-    } 
-} 
-static void done_initializing() 
-{ 
-    InterlockedDecrement((LONG*)&g_uModuleInitializing); 
-} 
+static CRITICAL_SECTION g_initializationCriticalSection;
+static BOOL g_bCSInitialized = (InitializeCriticalSection(&g_initializationCriticalSection),
TRUE);
+static void start_initializing()
+{
+    EnterCriticalSection(&g_initializationCriticalSection);
+}
+static void done_initializing()
+{
+    LeaveCriticalSection(&g_initializationCriticalSection);
+}
 
 #else
 



Mime
View raw message