Boost logo

Boost Users :

From: Raúl Huertas (raulh39_at_[hidden])
Date: 2006-12-12 16:09:43


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.


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