[osg-users] OpenThreads won't stop on Windows...

Robert Osfield robert.osfield at gmail.com
Wed Jan 6 01:08:30 PST 2016


Hi Shayne,

The thread won't exit at any random point, it'll exit when it checks
whether the thread is cancelled or not.  Have a look at the way
testCancel() and co-operatively which against a done flag are done in
the OSG, such as src/osg/OperationThread.cpp.

Robert

On 6 January 2016 at 04:56, Shayne Tueller <shayne.tueller at hill.af.mil> wrote:
> Hi,
>
> I'm using OpenThreads in an app that's using osgEarth. When I go to stop the thread, I call the cancel() method but it doesn't seem to be working. The thread is still running. Is there something else I need to do to stop the thread and shut it down? I have a stopThread() method that breaks out of my loop in the run() method, however, the thread is sometimes paused in execution inside the loop when I go to shut it down. I need to stop the thread unconditionally when I go to exit. I thought cancel() would do it but it doesn't work.
>
> Thoughts?
>
> Thank you!
>
> Shayne
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65955#65955
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list