Revision: 33532
http://sourceforge.net/p/opalvoip/code/33532
Author: rjongbloed
Date: 2015-04-22 09:35:29 +0000 (Wed, 22 Apr 2015)
Log Message:
-----------
Make sure deadlock detection is only done on ETIMEDOUT error for mutex, other errors should assert.
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2015-04-22 01:50:59 UTC (rev 33531)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2015-04-22 09:35:29 UTC (rev 33532)
@@ -1287,7 +1287,12 @@
absTime.tv_sec = time(NULL)+15;
absTime.tv_nsec = 0;
PPROFILE_PRE_SYSTEM();
- if (pthread_mutex_timedlock(&m_mutex, &absTime) != 0) {
+ /* Note, from man page "This function shall not return an error code of [EINTR]"
+ so we do not need a loop to retry. */
+ int err = pthread_mutex_timedlock(&m_mutex, &absTime);
+ if (err != ETIMEDOUT)
+ PAssertOS(err == 0);
+ else {
ExcessiveLockWait();
PAssertPTHREAD(pthread_mutex_lock, (&m_mutex));
PTRACE_BEGIN(0, "PTLib") << "Phantom deadlock in mutex " << this << PTrace::End;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|