PDA

View Full Version : CL_Thread work incorrect



flreey
10-25-2010, 02:28 AM
CL_Thread thread;
thread.start(mp_word, &Teapoy::Step);
thread.join();

while(!m_quit)
{
FrameCounter::Count();
Render();
}

void Teapoy::Render()
{
m_gc.clear(CL_Colorf::cyan);
mp_gui->exec(false);
FrameCounter::ShowFps(m_gc, 100, 200);
DrawBox2d();
mp_wm->draw_windows(m_gc);
CL_KeepAlive::process();
mp_window->flip();
}


void World::Step()
{
while (true)
{
mp_world->Step(m_timeStep, velocityIterations, positionIterations);
}
}

The threads will get into dead loop and not continue to process while (!m_quit) {..}block;
is a thread run this way?Or just my code error?