Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50566 - sandbox/thread_safe_signals/trunk/libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-01-13 14:49:58


Author: fmhess
Date: 2009-01-13 14:49:57 EST (Tue, 13 Jan 2009)
New Revision: 50566
URL: http://svn.boost.org/trac/boost/changeset/50566

Log:
Made mutex_test slightly less likely to deadlock in the
event of test failure.

Text files modified:
   sandbox/thread_safe_signals/trunk/libs/signals2/test/mutex_test.cpp | 6 +++++-
   1 files changed, 5 insertions(+), 1 deletions(-)

Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/mutex_test.cpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/libs/signals2/test/mutex_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/mutex_test.cpp 2009-01-13 14:49:57 EST (Tue, 13 Jan 2009)
@@ -236,8 +236,12 @@
                 BOOST_CHECK(!done_cond.timed_wait(lk, boost::posix_time::seconds(1),
                                                  boost::bind(&this_type::is_done,this)));
             }
-
             lock.unlock();
+ {
+ boost::mutex::scoped_lock lk(done_mutex);
+ BOOST_CHECK(done_cond.timed_wait(lk, boost::posix_time::seconds(1),
+ boost::bind(&this_type::is_done,this)));
+ }
             t.join();
             BOOST_CHECK(locked);
         }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk