Revision: 22343
http://opalvoip.svn.sourceforge.net/opalvoip/?rev=22343&view=rev
Author: csoutheren
Date: 2009-03-31 04:48:48 +0000 (Tue, 31 Mar 2009)
Log Message:
-----------
Simplify thread cleanup
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2009-03-31 04:42:00 UTC (rev 22342)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2009-03-31 04:48:48 UTC (rev 22343)
@@ -427,7 +427,7 @@
pthread_mutex_unlock(&thread->PX_suspendMutex);
// make sure the cleanup routine is called when the thread exits
- pthread_cleanup_push(&PThread::PX_ThreadEnd, arg);
+ //pthread_cleanup_push(&PThread::PX_ThreadEnd, arg);
PTRACE(5, "PTLib\tStarted thread " << thread << ' ' << thread->GetThreadName());
@@ -437,7 +437,8 @@
thread->Main();
// execute the cleanup routine
- pthread_cleanup_pop(1);
+ //pthread_cleanup_pop(1);
+ PX_ThreadEnd(arg);
// clean up tracing
#if PTRACING
@@ -455,7 +456,6 @@
{
PThread * thread = (PThread *)arg;
PProcess & process = PProcess::Current();
-PTRACE(1, "Called PX_ThreadEnd with " << thread->autoDelete);
process.OnThreadEnded(*thread);
bool deleteThread = thread->autoDelete; // make copy of the flag before perhaps deleting the thread
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|