[threads] read_write_mutex and condtion

Dear All,
Is it possible to use a boost::condition in combination with a
read_write_mutex? I've tried but failed. This is with 1.32.0. My test
code follows. As you can see it can use either a mutex or a
read_write_mutex depending on which bits are commented-out. It works as
expected with a mutex, but with a read_write_mutex I get a compiler
error, shown below.
Perhaps I am missing some fundamental reason why conditions can't work
with read_write_mutexes. Can someone explain?
Thanks, Phil.
#include <string>
#include <iostream>
#include

Phil Endecott wrote:
Dear All,
Is it possible to use a boost::condition in combination with a read_write_mutex? I've tried but failed. This is with 1.32.0. My test code follows. As you can see it can use either a mutex or a read_write_mutex depending on which bits are commented-out. It works as expected with a mutex, but with a read_write_mutex I get a compiler error, shown below.
Perhaps I am missing some fundamental reason why conditions can't work with read_write_mutexes. Can someone explain?
Thanks, Phil.
<snip> I'd ask if the same happens with 1.33.0, but since read_write_mutex is about to be pulled from Boost.Threads anyway (it's got some unrelated issues), it doesn't seem worth it. Just don't use read_write_mutex. -- don't quote this

Simon Buchan wrote:
I'd ask if the same happens with 1.33.0, but since read_write_mutex is about to be pulled from Boost.Threads anyway (it's got some unrelated issues), it doesn't seem worth it. Just don't use read_write_mutex.
That's bad news, where's that being discussed? -- Will Bryant http://carcino.gen.nz/ will@core-dev.co.nz +64 21 655 443
participants (3)
-
Phil Endecott
-
Simon Buchan
-
Will Bryant