Hi Peter,

a small thread example.

Hope it helps,

Andreas


void mythread(void *s)
{
        // do something
        _is_running = false;
}

Thread _thread = NULL;

...

if(OSG::Thread::find("MyThread") == NULL)
        _thread = OSG::Thread::get("MyThread");

_is_running = true;
_thread->runFunction(mythread, 0, NULL);

while(_is_running)
{
        // do something
        osgsleep(100);
}
Thread::join(_thread);


Hi

Is it possible to create self-defined threads with OpenSG? I only needed QT
for the QThread and/or QTimer-classes, so if creating threads is also
possible in OpenSG, then I don't need QT anymore, and the problem is
automagically fixed ;)

I noticed there is a OSG::OSGThread-class, but I'm not familiar with that
class, so it might only work on internal code.

Thanks,

--
Peter



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users






-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to