1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: GUI thread manager for GTK
4 // Author: Original from Wolfram Gloger/Guilhem Lavaux
8 // Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #include <sys/types.h>
24 /////////////////////////////////////////////////////////////////////////////
26 /////////////////////////////////////////////////////////////////////////////
28 static int p_thrd_pipe[2] = { -1, -1 };
30 static gint p_thrd_inid;
32 #define THREAD_SEND_EXIT_MSG(ptr) write(p_thrd_pipe[1], &ptr, sizeof(ptr));
35 ThreadExitProc(gpointer WXUNUSED(client), gint fid,
36 GdkInputCondition WXUNUSED(cond))
40 // printf( "thread exit proc.\n" );
42 if (fid != p_thrd_pipe[0])
45 if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr))
47 // printf( "calling OnExit %p\n", ptr);
52 // printf( "this should never happen\n" );
56 // Global initialization
57 static void wxThreadGuiInit()
60 p_thrd_inid = gdk_input_add(p_thrd_pipe[0], GDK_INPUT_READ,
65 static void wxThreadGuiExit()
67 gdk_input_remove(p_thrd_inid);
68 close(p_thrd_pipe[0]);
69 close(p_thrd_pipe[1]);
72 void wxMutexGuiEnter()
77 void wxMutexGuiLeave()
79 wxMainMutex->Unlock();