
Jos Hickson wrote:
On 07/02/2008, Clark Sims <clark_sims_boost@yahoo.com> 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. Best, John
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.
Regards,
Jos _______________________________________________ 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