]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/threadgui.inc
wxWindow::OnClose() removed completely from wxGTK, wxCloseEvent is now
[wxWidgets.git] / src / gtk1 / threadgui.inc
index 8195b0ddbdbb4c22ccc5828dc08f028314b3b146..1717b172f66143d4b9a3894ef9ca8f020ea81126 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <gdk/gdk.h>
 
-
 /////////////////////////////////////////////////////////////////////////////
 // Static variables
 /////////////////////////////////////////////////////////////////////////////
@@ -36,20 +35,26 @@ static void
 ThreadExitProc(gpointer WXUNUSED(client), gint fid,
                GdkInputCondition WXUNUSED(cond))
 {
-  wxThread* ptr;
+    wxThread* ptr;
+  
+    // printf( "thread exit proc.\n" );
 
-  if (fid != p_thrd_pipe[0])
-    return;
-  if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr)) {
-    //fprintf(stderr, "calling OnExit %p\n", ptr);
-    ptr->OnExit();
-  } else {
-    //fprintf(stderr, "this should never happen\n");
-  }
+    if (fid != p_thrd_pipe[0])
+        return;
+       
+    if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr)) 
+    {
+        // printf( "calling OnExit %p\n", ptr);
+        ptr->OnExit();
+    } 
+    else 
+    {
+        // printf( "this should never happen\n" );
+    }
 }
 
 // Global initialization
-static void wxThreadGuiInit(void)
+static void wxThreadGuiInit()
 {
   pipe(p_thrd_pipe);
   p_thrd_inid = gdk_input_add(p_thrd_pipe[0], GDK_INPUT_READ,
@@ -57,9 +62,19 @@ static void wxThreadGuiInit(void)
 }
 
 // Global cleanup
-static void wxThreadGuiExit(void)
+static void wxThreadGuiExit()
 {
   gdk_input_remove(p_thrd_inid);
   close(p_thrd_pipe[0]);
   close(p_thrd_pipe[1]);
 }
+
+void wxMutexGuiEnter()
+{
+  gs_mutexGui->Lock();
+}
+
+void wxMutexGuiLeave()
+{
+  gs_mutexGui->Unlock();
+}