From 1f87a9e4c0a1734fcdce52856cbae700171cc676 Mon Sep 17 00:00:00 2001 From: Roland Schwarz Date: Sat, 16 Dec 2006 16:17:55 +0000 Subject: [PATCH] Temporary test code for QNX debugging. [SVN r36430] --- src/condition.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/condition.cpp b/src/condition.cpp index 1496bc60..9daebab1 100644 --- a/src/condition.cpp +++ b/src/condition.cpp @@ -27,6 +27,12 @@ # include "mac/safe.hpp" #endif +// The following include can be removed after the bug on QNX +// has been tracked down. I need this only for debugging +//#if !defined(NDEBUG) && defined(BOOST_HAS_PTHREADS) +#include +//#endif + namespace boost { namespace detail { @@ -373,10 +379,17 @@ bool condition_impl::do_timed_wait(const xtime& xt, pthread_mutex_t* pmutex) int res = 0; res = pthread_cond_timedwait(&m_condition, pmutex, &ts); - assert(res != EINVAL); - assert(res != EPERM); - assert(res != EAGAIN); - assert(res != EFAULT); +// Test code for QNX debugging, to get information during regressions +#ifndef NDEBUG + if (res == EINVAL) { + boost::xtime now; + boost::xtime_get(&now, boost::TIME_UTC); + std::cerr << "now: " << now.sec << " " << now.nsec << std::endl; + std::cerr << "xtime: " << xt.sec << " " << xt.nsec << std::endl; + std::cerr << "ts: " << ts.tv_sec << " " << ts.tv_nsec << std::endl; + assert(res != EINVAL); + } +#endif assert(res == 0 || res == ETIMEDOUT); return res != ETIMEDOUT;