
--------------------------- Vicente Juan Botet Escriba ----- Original Message ----- From: "Anthony Williams" <anthony_w.geo@yahoo.com> To: <boost@lists.boost.org> Sent: Sunday, May 11, 2008 11:58 AM Subject: Re: [boost] [thread] is this reverse_lock class a source of errors?
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
Hi,
Consider the following situations:
{ unique_lock<mutex> lock(smtx);
// ... some writing operations
{ // non locked block reverse_lock< unique_lock<mutex> > rlock(lock); // ... some code not needing the mutex to be locked } // locked again
// ... }
Do you think this usage is souhaitable or is this source of errors?
I've had to do it myself a few times. I think it's worthwhile adding it to the library in order to ensure it is done as safely as possible.
Anthony
Great, I'm sure you will get a highly-polished implementation. Cheers, Vicente