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
}
}