Здравствуйте, roman313, Вы писали:
Thread.Object.h:
// Класс-"Поток"
class CThreadObject //: public
{
public:
// Конструктор
CThreadObject ()
{
m_hThread = NULL;
m_bIsCreated = FALSE;
}
// Деструктор
virtual
~CThreadObject ()
{
ExitAndDestroy (TRUE);
}
// Выход из потока и закрытие описателя потока.
_FORCEINLINE
BOOL_MAXIMUM ExitAndDestroy (ULONG_MAXIMUM ulmExitCode)
{
::ExitThread ((DWORD) ulmExitCode);
if (::CloseHandle (m_hThread))
{
m_hThread = NULL;
m_bIsCreated = FALSE;
return (TRUE);
}
return (FALSE);
}
ExitThread:
When this function is called (either explicitly or by returning from a thread procedure), the current thread's stack is deallocated, all pending I/O initiated by the thread is canceled, and the thread terminates.
То есть функция завершит текущую нить (ту, в которой вызван деструктор, а не m_hThread) и никогда не вернет управление.
Да, точно, надо доработать. Проверку поставить