Boost logo

Boost Users :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-05-08 11:18:29


"Mark Westcott" <mark-boost_at_[hidden]> writes:

> I'm experiencing a deadlock in the following code. After an timed out
> call to boost::shared_mutex::timed_lock(),
> boost::mutex::state.exclusive_waiting_blocked equals 1, which makes
> further attempts to shared_lock the mutex block indefinitely.

Well, they only block until all the threads currently holding shared_locks
release their locks, but your test should work: if you can't get an exclusive
lock, it should be OK to get a shared lock unless another thread is trying to
get an exclusive lock.

> Is this a bug, or are my expectations wrong?

It's a bug :-(
Timeouts on locks are a pain to get right.

I've filed it as issue #1905 on trac.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net