Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 29117 invoked from network); 5 May 2010 20:00:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 May 2010 20:00:21 -0000 Received: (qmail 82337 invoked by uid 500); 5 May 2010 20:00:21 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 82291 invoked by uid 500); 5 May 2010 20:00:20 -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 82284 invoked by uid 99); 5 May 2010 20:00:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 May 2010 20:00:20 +0000 X-ASF-Spam-Status: No, hits=-1243.6 required=10.0 tests=ALL_TRUSTED,AWL 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; Wed, 05 May 2010 20:00:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0158723888D7; Wed, 5 May 2010 19:59:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r941453 - in /activemq/activemq-cpp/branches/activemq-cpp-3.1.x: ./ activemq-cpp/src/main/decaf/lang/Thread.cpp Date: Wed, 05 May 2010 19:59:29 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100505195930.0158723888D7@eris.apache.org> Author: tabish Date: Wed May 5 19:59:29 2010 New Revision: 941453 URL: http://svn.apache.org/viewvc?rev=941453&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-277 Apply some user supplied suggestions to the Windows Thread code to try and fix a hang on Windows. Modified: activemq/activemq-cpp/branches/activemq-cpp-3.1.x/ (props changed) activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/decaf/lang/Thread.cpp Propchange: activemq/activemq-cpp/branches/activemq-cpp-3.1.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed May 5 19:59:29 2010 @@ -1 +1 @@ -/activemq/activemq-cpp/trunk:890958-890972,891025,902255,908080 +/activemq/activemq-cpp/trunk:890958-890972,891025,902255,908080,941035 Modified: activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/decaf/lang/Thread.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/decaf/lang/Thread.cpp?rev=941453&r1=941452&r2=941453&view=diff ============================================================================== --- activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/decaf/lang/Thread.cpp (original) +++ activemq/activemq-cpp/branches/activemq-cpp-3.1.x/activemq-cpp/src/main/decaf/lang/Thread.cpp Wed May 5 19:59:29 2010 @@ -117,6 +117,8 @@ namespace lang{ #ifdef HAVE_PTHREAD_H pthread_attr_destroy( &attributes ); + #else + ::CloseHandle( handle ); #endif } @@ -205,17 +207,13 @@ namespace{ ::TlsSetValue( currentThreadKey, NULL ); + properties->state = Thread::TERMINATED; + #ifndef _WIN32_WCE _endthreadex( 0 ); #else ExitThread( 0 ); #endif - - ::CloseHandle( properties->handle ); - - properties->state = Thread::TERMINATED; - - return NULL; } #endif @@ -415,7 +413,7 @@ void Thread::join() throw( decaf::lang:: void* theReturn = 0; pthread_join( properties->handle, &theReturn ); #else - Thread::join( INFINITE, 0 ); + ::WaitForSingleObject( properties->handle, INFINITE ); #endif } }