Hello!
I have some code called with '_beginthread()' and it executes fine. But when I get to the end of the thread function, I call '_endthread()' and it doesn't go beyond that... For example (pseudocode):
void MyThread(void *Duh)
{
print "Thread entered successfully."
Sleep(500);
print "Gonna execute '_endthread()'..."
_endthread();
print "Thread ended successfully"
}
...
_beginthread(MyThread, 0, 0);
will display:
Thread entered successfully.
Gonna execute '_endthread()'...
It never displays that last part ("Thread ended successfully") because it gets hung up on the _endthread() statement. Am I doing something wrong? Are resources getting hogged up because of this? Is _endthread() even necessary? Am I nuts?
Thanks in advance for the help!