Revision: 34792
http://sourceforge.net/p/opalvoip/code/34792
Author: rjongbloed
Date: 2016-04-25 13:12:57 +0000 (Mon, 25 Apr 2016)
Log Message:
-----------
Fixed tiny race condition where PThread::IsTerminated() could return true when thread is starting up.
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2016-04-23 13:12:10 UTC (rev 34791)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2016-04-25 13:12:57 UTC (rev 34792)
@@ -791,8 +791,15 @@
if (m_type == e_IsProcess)
return false; // Process is always still running
- if (PX_state == PX_finished)
- return true;
+ switch (PX_state) {
+ case PX_starting :
+ case PX_firstResume :
+ return false;
+ case PX_finished:
+ return true;
+ default :
+ break:
+ }
// See if thread is still running, copy variable in case changes between two statements
pthread_t id = m_threadId;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|