]> git.saurik.com Git - wxWidgets.git/commitdiff
attempt to fix waiting for a thread in another non-main thread
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jul 2003 19:06:27 +0000 (19:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jul 2003 19:06:27 +0000 (19:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/thread.cpp

index c166f73cf584de672faaea2e665489588ed43bdd..52b3291077bf2929fb26c86cacd16103a999c60b 100644 (file)
@@ -818,7 +818,15 @@ wxThreadInternal::WaitForTerminate(bool shouldCancel,
                     break;
 
                 case WAIT_OBJECT_0 + 1:
-                    // new message arrived, process it
+                    // new message arrived, process it -- but only if we're the
+                    // main thread as we don't support processing messages in
+                    // the other ones
+                    //
+                    // NB: we still must include QS_ALLINPUT even when waiting
+                    //     in a secondary thread because if it had created some
+                    //     window somehow (possible not even using wxWindows)
+                    //     the system might dead lock then
+                    if ( IsMain() )
                     {
                         // it looks that sometimes WAIT_OBJECT_0 + 1 is
                         // returned but there are no messages in the thread