thread: scoped_try_lock
Hello all, I have many good examples of how to use a scoped_lock, but I can find almost none on a scoped_try_lock. Can anyone point me to some good examples of this? Is there any decent documentation for this? I found the boost docs, by the author, a bit difficult to follow. Thanks, Rob ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com
Robert Marion escribió:
Hello all, I have many good examples of how to use a scoped_lock, but I can find almost none on a scoped_try_lock. Can anyone point me to some good examples of this?
No, and I've searched for it... :-( But a scoped_try_lock is not much different than a scoped_lock. You only have to check that you really enter the mutex: boost::try_mutex a_mutex; ... { boost::try_mutex::scoped_try_lock lock(a_mutex); if(lock.locked()) { //We're in!... } else { //Next time... } }
Is there any decent documentation for this? I found the boost docs, by the author, a bit difficult to follow.
I agree with that, but I was not able to find any documentation.
Thanks, Rob
Regards, Raul.
participants (2)
-
Raúl Huertas
-
Robert Marion