- Implemented support for underlined fonts in wxStaticText
+wxMSW:
+
+- Fixed infinite loop in wxThread::Wait() in console applications
2.8.2
// process a message while waiting for a(nother) thread, should return
// false if and only if we have to exit the application
virtual bool DoMessageFromThreadWait() = 0;
+
+ // wait for the handle to be signaled
+ virtual WXDWORD WaitForThread(WXHANDLE hThread) = 0;
};
#endif // _WX_MSW_APPTBASE_H_
virtual void AfterChildWaitLoop(void *data);
virtual bool DoMessageFromThreadWait();
+ virtual WXDWORD WaitForThread(WXHANDLE hThread);
};
#if wxUSE_GUI
virtual bool DoMessageFromThreadWait();
virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const;
+ virtual WXDWORD WaitForThread(WXHANDLE hThread);
};
#endif // wxUSE_GUI
return evtLoop->Dispatch();
}
+DWORD wxGUIAppTraits::WaitForThread(WXHANDLE hThread)
+{
+ return ::MsgWaitForMultipleObjects
+ (
+ 1, // number of objects to wait for
+ (HANDLE *)&hThread, // the objects
+ false, // wait for any objects, not all
+ INFINITE, // no timeout
+ QS_ALLINPUT | // return as soon as there are any events
+ QS_ALLPOSTMESSAGE
+ );
+}
+
wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const
{
OSVERSIONINFO info;
return true;
}
+WXDWORD wxConsoleAppTraits::WaitForThread(WXHANDLE hThread)
+{
+ return ::WaitForSingleObject((HANDLE)hThread, INFINITE);
+}
+
#if !defined(QS_ALLPOSTMESSAGE)
#define QS_ALLPOSTMESSAGE 0
#endif
-
- result = ::MsgWaitForMultipleObjects
- (
- 1, // number of objects to wait for
- &m_hThread, // the objects
- false, // don't wait for all objects
- INFINITE, // no timeout
- QS_ALLINPUT|QS_ALLPOSTMESSAGE // return as soon as there are any events
- );
+ wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+ if ( traits )
+ {
+ result = traits->WaitForThread(m_hThread);
+ }
+ else // can't wait for the thread
+ {
+ // so kill it below
+ result = 0xFFFFFFFF;
+ }
switch ( result )
{
// the system might dead lock then
if ( wxThread::IsMain() )
{
- wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits()
- : NULL;
-
if ( traits && !traits->DoMessageFromThreadWait() )
{
// WM_QUIT received: kill the thread