Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2002-07-12 15:30:28


Bill,

We've had a problem with recursive_mutex on Solaris using GCC 2.95.3 using
Boost 1.27.0. Occasionally we get the assert failing after the
pthread_mutex_unlock on line 328 of recursive_mutex.cpp. On further
investigation we've found that m_count seems to be getting decremented below
zero, so is ending up as 4 billion or so. Since the mutex in question is
being used in a condition, we had a look at

    void recursive_mutex::do_unlock(cv_state& state)

and it occurs to us that we should add

    m_count = 0;

at the very end. Certainly that seems to have fixed the problem.

Is this the right fix, and does something similar need to be applied in
other places, eg. recursive_try_mutex?

Mark


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