Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void PThread::Terminate (  )  [virtual, inherited]

Terminate the thread. It is highly recommended that this is not used except in abnormal abort situations as not all clean up of resources allocated to the thread will be executed. This is especially true in C++ as the destructors of objects that are automatic variables are not called causing at the very least the possiblity of memory leaks.

Note that the correct way for a thread to terminate is to return from the Main()# function or self terminate by calling Terminate()# within the context of the thread which can then assure that all resources are cleaned up.

Reimplemented in PProcess, PServiceProcess, and LauncherThread.

Definition at line 1321 of file win32.cxx.

References PThread::Current().

Referenced by PVideoInputDevice_VideoForWindows::Close(), and PThread::~PThread().

{
  PAssert(originalStackSize > 0, PLogicError);

  if (Current() == this)
    ExitThread(0);
  else
    TerminateThread(threadHandle, 1);
}


Generated by  Doxygen 1.6.0   Back to index