Vladimir Prus wrote:
Kevin Wheatley wrote:
On Windows I'm getting the:
res = WaitForSingleObject(reinterpret_cast<HANDLE>(m_thread), INFINITE); assert(res == WAIT_OBJECT_0); res = CloseHandle(reinterpret_cast<HANDLE>(m_thread)); assert(res);
res == WAIT_OBJECT_0 assert failing, but I have no idea why because I'm not told it failed due to the void thread::join().
I don't yet know if thread::join should return something or throw an exception, but reporting the error in a better way is desirable. On Linux, assert can be replaced with "perror/abort" combination, and on windows something like that should be also possible ("FormatMessage"?).
Anybody objects if I make the change for Linux?
Yes. assert is not equivalent to perror/abort. The two have different meanings and are not interchangeable.