## Recommended Posts

I have a background thread running in my game, and my problem is it just vanishes after the first few seconds. I'm on a dual core windows XP machine.
class ThreadClass
{
protected:

public:

void begin()
{
end();  // just to be safe.

0,
this,
0,

if( threadHandle == NULL )		{
// Arrooga! Dive, dive!  And deal with the error, too!
}

}

void end()
{
//----------a breakpoint here never gets called
{
}
}

};

}


and then a basic class inherits from it :
class ThreadGrouper : public ThreadClass
{
//stuff here
public:
{
while(1)
{
//mainloop stuff
}
//--------a breakpoint here never gets called
return 0;
}
}

The stuff in the while loop runs for a bit at startup, then its just gone and putting a breakpoint in gets nothing. the end() function never gets called, so I have no idea what is happening, or how to debug it. Could anyone point me in the right direction?

##### Share on other sites
Evil Steve    2017
If you break to the debugger, what does the Threads window show? That'll allow you to jump to the other thread and see what it's doing.

##### Share on other sites
Ah thanks, I am still new to threading and never noticed that thread window before. It seems it deadlocked itself. I think I can fix it now, thanks.

## Create an account

Register a new account