Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B3CA4A78 for ; Mon, 9 May 2011 18:40:59 +0000 (UTC) Received: (qmail 77878 invoked by uid 500); 9 May 2011 18:40:59 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 77846 invoked by uid 500); 9 May 2011 18:40:59 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 77839 invoked by uid 99); 9 May 2011 18:40:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2011 18:40:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2011 18:40:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D222E23889B1; Mon, 9 May 2011 18:40:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110509184037.D222E23889B1@eris.apache.org> 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);