]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/threadpsx.cpp
document On{Open,Save}Document()
[wxWidgets.git] / src / unix / threadpsx.cpp
index 5d7c3bcd2aba900fe340779a8f24c01d63907ba9..8e7d9bba9fd26fe9748bc2dad00a067a2519914a 100644 (file)
 #if wxUSE_THREADS
 
 #include "wx/thread.h"
 #if wxUSE_THREADS
 
 #include "wx/thread.h"
+#include "wx/except.h"
 
 #ifndef WX_PRECOMP
 
 #ifndef WX_PRECOMP
+    #include "wx/app.h"
     #include "wx/dynarray.h"
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/dynarray.h"
     #include "wx/intl.h"
     #include "wx/log.h"
@@ -826,11 +828,15 @@ void *wxThreadInternal::PthreadStart(wxThread *thread)
                    _T("Thread %ld about to enter its Entry()."),
                    THR_ID(pthread));
 
                    _T("Thread %ld about to enter its Entry()."),
                    THR_ID(pthread));
 
-        pthread->m_exitcode = thread->Entry();
+        wxTRY
+        {
+            pthread->m_exitcode = thread->Entry();
 
 
-        wxLogTrace(TRACE_THREADS,
-                   _T("Thread %ld Entry() returned %lu."),
-                   THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
+            wxLogTrace(TRACE_THREADS,
+                       _T("Thread %ld Entry() returned %lu."),
+                       THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
+        }
+        wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
 
         {
             wxCriticalSectionLocker lock(thread->m_critsect);
 
         {
             wxCriticalSectionLocker lock(thread->m_critsect);
@@ -1311,7 +1317,7 @@ void wxThread::SetPriority(unsigned int prio)
 
             // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY
             // to Unix priorities 20..-20
 
             // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY
             // to Unix priorities 20..-20
-            if ( setpriority(PRIO_PROCESS, 0, -(2*prio)/5 + 20) == -1 )
+            if ( setpriority(PRIO_PROCESS, 0, -(2*(int)prio)/5 + 20) == -1 )
             {
                 wxLogError(_("Failed to set thread priority %d."), prio);
             }
             {
                 wxLogError(_("Failed to set thread priority %d."), prio);
             }
@@ -1542,7 +1548,11 @@ void wxThread::Exit(ExitCode status)
     // might deadlock if, for example, it signals a condition in OnExit() (a
     // common case) while the main thread calls any of functions entering
     // m_critsect on us (almost all of them do)
     // might deadlock if, for example, it signals a condition in OnExit() (a
     // common case) while the main thread calls any of functions entering
     // m_critsect on us (almost all of them do)
-    OnExit();
+    wxTRY
+    {
+        OnExit();
+    }
+    wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
 
     // delete C++ thread object if this is a detached thread - user is
     // responsible for doing this for joinable ones
 
     // delete C++ thread object if this is a detached thread - user is
     // responsible for doing this for joinable ones
@@ -1790,12 +1800,12 @@ static void DeleteThread(wxThread *This)
     }
 }
 
     }
 }
 
-void wxMutexGuiEnter()
+void wxMutexGuiEnterImpl()
 {
     gs_mutexGui->Lock();
 }
 
 {
     gs_mutexGui->Lock();
 }
 
-void wxMutexGuiLeave()
+void wxMutexGuiLeaveImpl()
 {
     gs_mutexGui->Unlock();
 }
 {
     gs_mutexGui->Unlock();
 }