]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/thread.cpp
forgot to commit some regenerated files
[wxWidgets.git] / src / os2 / thread.cpp
index db6ba0651071baa64bc0a29d827766b890518262..04ee638e57bf42b272ee7360aa6804c74b128d2c 100644 (file)
@@ -9,6 +9,10 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+#ifdef __GNUG__
+    #pragma implementation "thread.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
@@ -30,8 +34,9 @@
 #define INCL_DOSPROCESS
 #define INCL_ERRORS
 #include <os2.h>
+#ifndef __EMX__
 #include <bseerr.h>
-
+#endif
 // the possible states of the thread ("=>" shows all possible transitions from
 // this state)
 enum wxThreadState
@@ -479,6 +484,9 @@ bool wxThreadInternal::Create(
     {
         SetPriority(m_nPriority);
     }
+
+    m_eState = STATE_NEW;
+
     return(TRUE);
 }
 
@@ -815,6 +823,28 @@ void WXDLLEXPORT wxWakeUpMainThread()
 {
 }
 
+void WXDLLEXPORT wxMutexGuiEnter()
+{
+    // this would dead lock everything...
+    wxASSERT_MSG( !wxThread::IsMain(),
+                  wxT("main thread doesn't want to block in wxMutexGuiEnter()!") );
+
+    // the order in which we enter the critical sections here is crucial!!
+
+    // set the flag telling to the main thread that we want to do some GUI
+    {
+        wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui);
+
+        gs_nWaitingForGui++;
+    }
+
+    wxWakeUpMainThread();
+
+    // now we may block here because the main thread will soon let us in
+    // (during the next iteration of OnIdle())
+    gs_pCritsectGui->Enter();
+}
+
 void WXDLLEXPORT wxMutexGuiLeave()
 {
     wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui);