Hello Georg,

Georg Stevenson wrote:
> One of them is following code snippet which occurs in some of the 
> multithreading relevant classes:
> 
> TransformationPipeMT.h:
> ...
> OSG::Lock* pipeLock;
> ...
> 
> TransformationPipeMT.cpp:
> ...
> #ifdef OPENSG_18
>     pipeLock = dynamic_cast<OSG::Lock*> 
> (OSG::ThreadManager::the()->getLock(lockName.c_str()));
> #else
> #ifdef OPENSG_20
>    //TODO
> #endif
> ..
> 
> First: i can't find a way to use the given LockTransitPtr (from getLock 
> ) as Lock*.

the threading/synchronization objects are now correctly ref counted as 
well, so you need to hold them with e.g. OSG::LockRefPtr. The 
*TransitPtr types exist solely to prevent you from getting a raw C ptr 
because then the TransitPtr d'tor would decrement the objects ref count 
and your raw C ptr would point to a deleted object.

The above needs to become:

TransformationPipeMT.h:
OSG::LockRefPtr pipeLock;

TransformationPipeMT.cpp:
pipeLock = OSG::dynamic_pointer_cast<OSG::Lock>(
     OSG::ThreadManager::the()->getLock(lockname.c_str(), false));

> Second: getLock takes Argument bGlobal (true||false) which i can't find 
> documentation for.

It indicates whether the object is held in a global variable (one that 
is only destroyed after osgExit has already run), because for those the 
ThreadManager behaves slightly differently when it shuts down.

        Cheers,
                Carsten


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to