activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1101141 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows: PlatformDefs.h PlatformThread.cpp
Date Mon, 09 May 2011 18:40:37 GMT
Author: tabish
Date: Mon May  9 18:40:37 2011
New Revision: 1101141

URL: http://svn.apache.org/viewvc?rev=1101141&view=rev
Log:
Fix some issues with the windows side of the threading updates

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformDefs.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformThread.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformDefs.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformDefs.h?rev=1101141&r1=1101140&r2=1101141&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformDefs.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformDefs.h
Mon May  9 18:40:37 2011
@@ -56,7 +56,7 @@ namespace concurrent{
     typedef HANDLE decaf_thread_t;
     typedef DWORD decaf_tls_key;
     typedef HANDLE decaf_condition_t;
-    typedef CRITICAL_SECTION decaf_mutex_t;
+    typedef LPCRITICAL_SECTION decaf_mutex_t;
 
 }}}}
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformThread.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformThread.cpp?rev=1101141&r1=1101140&r2=1101141&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformThread.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/PlatformThread.cpp
Mon May  9 18:40:37 2011
@@ -36,27 +36,29 @@ using namespace decaf::internal::util::c
 
 ////////////////////////////////////////////////////////////////////////////////
 void PlatformThread::createMutex(decaf_mutex_t* mutex) {
-    ::InitializeCriticalSection(mutex);
+	*mutex = new CRITICAL_SECTION;
+    ::InitializeCriticalSection(*mutex);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PlatformThread::lockMutex(decaf_mutex_t mutex) {
-    ::EnterCriticalSection(&mutex);
+    ::EnterCriticalSection(mutex);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PlatformThread::tryLockMutex(decaf_mutex_t mutex) {
-    return ::TryEnterCriticalSection(&mutex) > 0 ? true : false;
+    return ::TryEnterCriticalSection(mutex) > 0 ? true : false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PlatformThread::unlockMutex(decaf_mutex_t mutex) {
-    ::LeaveCriticalSection(&mutex);
+    ::LeaveCriticalSection(mutex);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PlatformThread::destroyMutex(decaf_mutex_t mutex) {
-    ::DeleteCriticalSection(&mutex);
+    ::DeleteCriticalSection(mutex);
+	delete mutex;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -142,7 +144,7 @@ bool PlatformThread::interruptibleWaitOn
 
         if (timedOut == WAIT_TIMEOUT) {
 
-            // interruption events take precedence over timeout.
+			// interruption events take precedence over timeout.
             if (complete(true)) {
                break;
             }
@@ -153,7 +155,7 @@ bool PlatformThread::interruptibleWaitOn
 
         // check if spurious wake or intentional.
         if (complete(false)) {
-           break;
+            break;
         }
 
         timeOut = initialTimeOut - (::GetTickCount() - startTime);



Mime
View raw message