rem: producer =  dynamic_cast<OSG::Thread *>( ThreadManager::the()->getThread("Producer", "OSGThread") );
add: producer =  OSG::Thread::get("Producer");
context: int main (int argc, char **argv){    // OSG init    osgInit(argc,argv);    // GLUT init    glutInit(&argc, argv);    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);    int winid = glutCreateWindow("OpenSG");    glutReshapeFunc(reshape);    glutDisplayFunc(display);    glutIdleFunc(display);    glutMouseFunc(mouse);    glutMotionFunc(motion);    glutKeyboardFunc(key);    // the connection between GLUT and OpenSG    GLUTWindowPtr gwin= GLUTWindow::create();    gwin->setWinID(winid);    gwin->init();    // create the geometry to manipulate        plane = makePlaneGeo( 6, 6, 32, 32 );    beginEditCP(plane);    plane->setDlistCache(false);    endEditCP(plane);        NodePtr scene = Node::create();       beginEditCP(scene);    scene->setCore(plane);    endEditCP(scene);    // setup the logger to add timestamps    osgLog().addHeaderElem(LOG_TIMESTAMP_HEADER);        // create the barrier    syncBarrier = ThreadManager::the()->getBarrier("Producer");       // create the producer thread    producer =  dynamic_cast<OSG::Thread *>(                    ThreadManager::the()->getThread("Producer", "OSGThread") );        if(producer == NULL)    {        FFATAL(("Could not create thread\n"));        return 1;    }    // Populate the producer's aspect    Thread::getCurrent()->getChangeList()->applyTo(1);    Thread::getCurrent()->getChangeList()->clearAll();        // run it, using a separate aspect    producer->run(produce, 1, (void *) NULL );    // create the SimpleSceneManager helper    mgr = new SimpleSceneManager;    mgr->setWindow( gwin );    mgr->setRoot( scene );    mgr->showAll();    // GLUT main loop    glutMainLoop();    return 0;}