[Boost-bugs] [Boost C++ Libraries] #2146: recursive_mutex::locked() bug

Subject: [Boost-bugs] [Boost C++ Libraries] #2146: recursive_mutex::locked() bug
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-07-24 23:59:37


#2146: recursive_mutex::locked() bug
------------------------------------+---------------------------------------
 Reporter: sidharth_at_[hidden] | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: Boost 1.35.1 | Component: thread
  Version: Boost 1.35.0 | Severity: Problem
 Keywords: |
------------------------------------+---------------------------------------
 Hello,

 Calling locked() on a recursive mutex on Win32 (haven't tried other
 platforms) always returns true.

 The implementation of this function (pasted below) compares the active
 count against MIN_INT and the result is always true.

 A search for this function in the tests did not yield any results. It does
 not seem like this function is tested.

 From a review of the most recent source from subversion, the bug doesn't
 seem to be fixed.

 Thanks.

 ----------------

  bool locked()
  {
      return get_active_count()>=lock_flag_value;
  }

 BOOST_STATIC_CONSTANT(long,lock_flag_value=0x80000000);

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2146>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC