X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b89156b5dbb3c1270452379801a79613cd69bb32..1ee17e1c421b64b3a356fee82f454ab4b43ab50c:/src/gtk1/threadgui.inc diff --git a/src/gtk1/threadgui.inc b/src/gtk1/threadgui.inc index 165fef3c01..7f29dc9cf1 100644 --- a/src/gtk1/threadgui.inc +++ b/src/gtk1/threadgui.inc @@ -21,7 +21,6 @@ #include - ///////////////////////////////////////////////////////////////////////////// // Static variables ///////////////////////////////////////////////////////////////////////////// @@ -36,16 +35,22 @@ 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 @@ -63,3 +68,14 @@ static void wxThreadGuiExit() close(p_thrd_pipe[0]); close(p_thrd_pipe[1]); } + +void wxMutexGuiEnter() +{ + wxMainMutex->Lock(); +} + +void wxMutexGuiLeave() +{ + wxMainMutex->Unlock(); +} +