Boost logo

Boost :

From: James Ahlborn (james.ahlborn_at_[hidden])
Date: 2004-09-16 09:26:46


I previously posted about issues when using a recursive_mutex and a condition.
after some more inspection, it turns out it is a minor bug in the
recursive_mutex implementation (the pthread version). I've included the patch
below, which was generated against the 1.31.0 version of boost (but the bug is
still in the latest cvs as well). Would be great if someone could integrate
this into the latest code, or possibly a bug fix release for 1.31 (this is a
major bug for anyone using recursive_mutex with condition).

thanks,
-james

*** boost_1_31_0/libs/thread/src/recursive_mutex.cpp Fri Dec 26 18:22:00 2003
--- boost_1_31_0.jta/libs/thread/src/recursive_mutex.cpp Thu Sep 16
10:01:10 2004
***************
*** 412,417 ****
--- 412,418 ----

      state.pmutex = &m_mutex;
      state.count = m_count;
+ m_count = 0;
  }

  recursive_try_mutex::recursive_try_mutex()
***************
*** 608,613 ****
--- 609,615 ----

      state.pmutex = &m_mutex;
      state.count = m_count;
+ m_count = 0;
  }

  recursive_timed_mutex::recursive_timed_mutex()
***************
*** 787,792 ****
--- 789,795 ----

      state.pmutex = &m_mutex;
      state.count = m_count;
+ m_count = 0;
  }
  #elif defined(BOOST_HAS_MPTASKS)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk