Boost logo

Boost Users :

From: Goroll, Torsten (Torsten.Goroll_at_[hidden])
Date: 2006-12-14 09:12:46


Hi,

as I understand the scoped_lock, it locks every ressource in a code block. What if I dont want to lock a ressource all the time the method is running? Do I have to create a new method?

Example:

boost::mutex a_mutex;
...
{
        boost::mutex::scoped_lock lock(a_mutex);
        cou<<"bla";

        //much of code where cout dont has to be locked
        ...
}

Torsten

-----Ursprüngliche Nachricht-----
Von: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]]Im Auftrag von
boost-users-request_at_[hidden]
Gesendet: Donnerstag, 14. Dezember 2006 14:55
An: boost-users_at_[hidden]
Betreff: Boost-users Digest, Vol 1117, Issue 1

Send Boost-users mailing list submissions to
        boost-users_at_[hidden]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.boost.org/mailman/listinfo.cgi/boost-users
or, via email, send a message with subject or body 'help' to
        boost-users-request_at_[hidden]

You can reach the person managing the list at
        boost-users-owner_at_[hidden]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Boost-users digest..."


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