Revision: 21629
http://opalvoip.svn.sourceforge.net/opalvoip/?rev=21629&view=rev
Author: csoutheren
Date: 2008-11-26 12:46:17 +0000 (Wed, 26 Nov 2008)
Log Message:
-----------
Do not use PTRACE during the destructor of an auto-delete thread
It is bad.
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2008-11-26 04:22:44 UTC (rev 21628)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2008-11-26 12:46:17 UTC (rev 21629)
@@ -345,10 +345,11 @@
// PProcess is a subclass of PThread, if the PProcess instance is deleted,
// this destructor runs but PProcessInstance is already set to NULL
if (PProcessInstance != NULL) {
- if (this != PProcessInstance)
- PTRACE(1, "PWLib\tDestroyed thread " << this << ' ' << threadName << "(id = " << ::hex << PX_threadId << ::dec << ")");
- else
+ if (this == PProcessInstance)
PProcessInstance = NULL;
+ else {
+ PTRACE_IF(1, !autoDelete, "PWLib\tDestroyed thread " << this << ' ' << threadName << "(id = " << ::hex << PX_threadId << ::dec << ")");
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|