> Guarding against mulitple lock and unlocks being called by > the same thread is what ReentrantMutex is all about. It > avoids the mulitple lock so only ever needs to do one unlock. > OpenThreads::Mutex is designed not to be reentrant so this > type of usage is not safe, so it should be ok not worry about > trying to match th EntrerCriticalSection/LeaveCriticalSection.
In that case, the CRITICAL_SECTION version is trivial and should be efficient and clean. Any guidance on trylock()? From my previous email... > > I'm also unsure of what the semantics and return code should be for > > trylock(): > > * Should this function take the lock if it can? What should the > > return code be in this case? > > * If the current thread can't take the lock, what should > the return > > code be? > > * Finally, if the current thread already owns the lock, > what should > > the return code be? _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
