Hi Michael --

I believe that after you cancel it, you should test to see if it has actually been canceled, something like this:

myThread->start();
myThread->cancel();
while( !myThread->iSRunning() )
  OpenThreads::Thread::microSleep( 100 );
myThread->start();

Also, I'm not sure what you are trying to accomplish by calling join(). It doesn't seem necessary to accomplish your stated goal.

Note that you are incurring some significant overhead to cancel and then restart a thread. If all you need to do is temporarily pause the thread, you should consider using a Barrier for a more efficient solution.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466

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

Reply via email to