// wxThread (Posix implementation)
//--------------------------------------------------------------------
+// the thread callback functions must have the C linkage
+extern "C"
+{
+
#if HAVE_THREAD_CLEANUP_FUNCTIONS
+ // thread exit function
+ void wxPthreadCleanup(void *ptr);
+#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
-// thread exit function
-extern "C" void wxPthreadCleanup(void *ptr);
+void *wxPthreadStart(void *ptr);
-#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
+} // extern "C"
class wxThreadInternal
{
~wxThreadInternal();
// thread entry function
- static void *PthreadStart(void *ptr);
+ static void *PthreadStart(wxThread *thread);
// thread actions
// start the thread
// thread startup and exit functions
// ----------------------------------------------------------------------------
-void *wxThreadInternal::PthreadStart(void *ptr)
+void *wxPthreadStart(void *ptr)
+{
+ return wxThreadInternal::PthreadStart((wxThread *)ptr);
+}
+
+void *wxThreadInternal::PthreadStart(wxThread *thread)
{
- wxThread *thread = (wxThread *)ptr;
wxThreadInternal *pthread = thread->m_internal;
// associate the thread pointer with the newly created thread so that
#if HAVE_THREAD_CLEANUP_FUNCTIONS
// install the cleanup handler which will be called if the thread is
// cancelled
- pthread_cleanup_push(wxPthreadCleanup, ptr);
+ pthread_cleanup_push(wxPthreadCleanup, thread);
#endif // HAVE_THREAD_CLEANUP_FUNCTIONS
// wait for the condition to be signaled from Run()
(
m_internal->GetIdPtr(),
&attr,
- wxThreadInternal::PthreadStart,
+ wxPthreadStart,
(void *)this
);