if (data->handle == NULL)
{
+ DWORD lasterr = GetLastError();
thread->state = NULL;
delete data;
- throw CoreException(std::string("Unable to create new thread: ") + dlerror());
+ std::string err = "Unable to create new thread: " + ConvToStr(lasterr);
+ SetLastError(ERROR_SUCCESS);
+ throw CoreException(err);
}
}
{
thread->SetExitFlag();
WaitForSingleObject(handle,INFINITE);
+ CloseHandle(handle);
}
class ThreadSignalSocket : public BufferedSocket