Hi Stefan,

On Mon, Feb 15, 2010 at 8:35 AM, Stefan Eilemann <[email protected]> wrote:

> > if I remember correctly, the ReentrantMutex came into existence because
> on Windows the normal Mutex was reentrant (a single thread could lock it
> more than once). So ReentrantMutex was created to make a consistent mutex on
> all platforms...
>
> That may be so. The issue at hand is that the ReentrantMutex on pthreads
> only works if your threads are created using OpenThreads (it uses
> Thread::CurrentThread() which requires some TLS created by Thread::start()).
> Since in my case the render threads are already running, this mutex
> deadlocks. A plain Mutex doesn't need all this and works correctly.
>

At the end of last week I checked in a refactor of
OpenThreads::ReentrantMutex and Mutex so that the implementation of
recursive/reentrant mutex is left to the underlying threading library (i.e.
pthreads) rather than using OpenThreads code to attempt to implement it.
This refactor does away with the need to CurrentThread() etc, so code that
works with the standard Mutex should now work just fine the new
ReentrantMutex.

Could you try the OSG-2.9.7 release of svn/trunk and see if the problem you
were seeing still exists?  I'm hopefully that we won't need any mods to the
OSG such as in your suggestion of changing the ReentrantMutex to a Mutex.

Cheers,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to