Page 1 of 1

wxThread.Wait() generate error messages

Posted: Fri Nov 17, 2006 1:10 am
by kylenix
I have two joinable threads
AThread::AThread():wxThread(wxTHREAD_JOINABLE)
{}
BThread::BThread():wxThread(wxTHREAD_JOINABLE)
{}

everything runs well until I do wxThread::Delete() and then wxThread::Wait()
the following error messages came out:
12:06:21: Error: Can not wait for thread termination (error 0: the operation completed successfully.)
12:06:21: Error: Couldn't terminate thread (error 0: the operation completed successfully.)
anything wrong ?

Posted: Mon Nov 20, 2006 8:41 am
by Peer Sommerlund
The documentation is not good enough here. :( The current implementation (at least wxMSW) requires you to do EITHER Delete() OR Wait().

That is, Delete includes an implicit Wait.

If you do both, you will be waiting on a non-existing object.

See bug 1225646 on SF

Posted: Mon Nov 20, 2006 9:11 am
by rve
Had the same problem (see http://forums.wxwidgets.org/viewtopic.php?t=10873) and my conclusion was also the documentation was incorrect.

Could not find the bug report though...