From: John Torjo (john.groups_at_[hidden])
Date: 2008-02-07 07:44:19
Jos Hickson wrote:
> On 07/02/2008, Clark Sims <clark_sims_boost_at_[hidden]> wrote:
>> I would like it to deadlock on windows, because I just wrote a large header file, which assumes that a deadlock will occur. In fact, I don't know how I am going to program mutex's and locks, if they act like recursive locks on windows, but scoped locks on linux.
> We've noticed this variation behaviour in the past when using
> boost::mutex. Under the hood on Windows it uses a critical section
> which I believe is recursive. Not sure if the rewritten version of
> Boost.Threads will do the same.
Yes, critical sections are recursive.
I looked a bit at this: http://rafb.net/p/u0LDDP45.html
Did not look into too much detail, *but*
you can definitely make it work even in the presence of recursive mutexes.
> Sorry, but all I can do is confirm the behaviour. I believe the
> Boost.Threads concept documentation for mutex and scoped_lock say that
> attempting a recursive lock gives "undefined behaviour" rather than
> definitely deadlocking.
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert http://blog.torjo.com ... call me only if you want things done right
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk