Allow wxThread::Wait() and Delete() to block, even under wxMSW.
Add "wait mode" parameter to these methods which can be used to make them block even under wxMSW where they currently dispatch messages when called which can be totally unexpected. Do keep the old behaviour for compatibility however, although it will change i 3.2. Closes #12998. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -661,18 +661,18 @@ wxThreadError wxThread::Resume()
|
||||
// stopping thread
|
||||
// ---------------
|
||||
|
||||
wxThread::ExitCode wxThread::Wait()
|
||||
wxThread::ExitCode wxThread::Wait(wxThreadWait waitMode)
|
||||
{
|
||||
// although under Windows we can wait for any thread, it's an error to
|
||||
// wait for a detached one in wxWin API
|
||||
wxCHECK_MSG( !IsDetached(), (ExitCode)-1,
|
||||
wxT("can't wait for detached thread") );
|
||||
ExitCode rc = (ExitCode)-1;
|
||||
(void)Delete(&rc);
|
||||
(void)Delete(&rc, waitMode);
|
||||
return(rc);
|
||||
}
|
||||
|
||||
wxThreadError wxThread::Delete(ExitCode *pRc)
|
||||
wxThreadError wxThread::Delete(ExitCode *pRc, wxThreadWait WXUNUSED(waitMode))
|
||||
{
|
||||
ExitCode rc = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user