hi Torbenand

OpenThreads::ScopedLock do what the name says. It works with sync objects
(like Mutex) to make the scope of the lock thread safe. At the construction
it locks the sync object and in the destructor it release it

so for example

{
OpenThreads::ScopedLock<OpenThreads::Mutex> l(myMutex) ... << here the
myMutex->lock() happens
}
when leaving the scope it does myMutex->unlock()

Look in the code for more clue

-Nick


On Tue, Feb 23, 2010 at 3:51 PM, Torben Dannhauer <
[email protected]> wrote:

> Hi,
>
> I have to secure a std::vector for multithreaded access and used a
> Reentrant Mutex for this.
>
> (btw: Whats the diferent between reentrant mutex and mutex?)
>
> On my development Platform (Vista) this works great.
> On windows XP 32 bit, the application hangs on this mutex, although it is
> not locked.
>
>
> What is the best way to secure access to a std::vector which should run on
> all platforms?
>
> I' have seen this scopedLock is often used, by I have no clue what this is
> about and how it works.
>
> Has anybody an idea where to get further information?
>
> Thank you!
>
> Cheers,
> Torbenand Wind
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=24697#24697
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to