From 7f42651bb1ae995dc7543c5cae9eb43d5c8f964b Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Tue, 22 Oct 2002 07:11:32 +0000 Subject: [PATCH] Committing in . OpenVMS specific changes: setup.h_vms : updated configuration for OpenVMS threadspsx.cpp : the type long on OpenVMS is 32 bits. therefor some casts are changed to long long, for OpenVMS only. Modified Files: Tag: WX_2_4_BRANCH wxWindows/setup.h_vms wxWindows/src/unix/threadpsx.cpp ---------------------------------------------------------------------- git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- setup.h_vms | 1 + src/unix/threadpsx.cpp | 46 +++++++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/setup.h_vms b/setup.h_vms index 9b4a173c66..8632c5a5ad 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -94,6 +94,7 @@ #undef __NETBSD__ #undef __BSD__ #undef __FREEBSD__ +#undef __OPENBSD__ #define __VMS__ #undef __ULTRIX__ #undef __DATA_GENERAL__ diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index add39edb3e..b4b91685b9 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -696,8 +696,12 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) { wxThreadInternal *pthread = thread->m_internal; - wxLogTrace(TRACE_THREADS, _T("Thread %ld started."), (long)pthread->GetId()); - +#ifdef __VMS + wxLogTrace(TRACE_THREADS, _T("Thread %ld started."), (long long)pthread->GetId()); +#else + wxLogTrace(TRACE_THREADS, _T("Thread %ld started."), (long)pthread->GetId()); +#endif + // associate the thread pointer with the newly created thread so that // wxThread::This() will work int rc = pthread_setspecific(gs_keySelf, thread); @@ -734,13 +738,21 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) { // call the main entry wxLogTrace(TRACE_THREADS, _T("Thread %ld about to enter its Entry()."), +#ifdef __VMS + (long long)pthread->GetId()); +#else (long)pthread->GetId()); - +#endif + pthread->m_exitcode = thread->Entry(); wxLogTrace(TRACE_THREADS, _T("Thread %ld Entry() returned %lu."), +#ifdef __VMS + (long long)pthread->GetId(), (unsigned long)pthread->m_exitcode); +#else (long)pthread->GetId(), (unsigned long)pthread->m_exitcode); - +#endif + { wxCriticalSectionLocker lock(thread->m_critsect); @@ -849,8 +861,12 @@ void wxThreadInternal::Wait() wxMutexGuiLeave(); wxLogTrace(TRACE_THREADS, +#ifdef __VMS + _T("Starting to wait for thread %ld to exit."), (long long)GetId()); +#else _T("Starting to wait for thread %ld to exit."), (long)GetId()); - +#endif + // to avoid memory leaks we should call pthread_join(), but it must only be // done once so use a critical section to serialize the code below { @@ -888,8 +904,12 @@ void wxThreadInternal::Pause() wxCHECK_RET( m_state == STATE_PAUSED, wxT("thread must first be paused with wxThread::Pause().") ); - wxLogTrace(TRACE_THREADS, _T("Thread %ld goes to sleep."), (long)GetId()); - +#ifdef __VMS + wxLogTrace(TRACE_THREADS, _T("Thread %ld goes to sleep."), (long long)GetId()); +#else + wxLogTrace(TRACE_THREADS, _T("Thread %ld goes to sleep."), (long)GetId()); +#endif + // wait until the semaphore is Post()ed from Resume() m_semSuspend.Wait(); } @@ -903,8 +923,12 @@ void wxThreadInternal::Resume() // TestDestroy() since the last call to Pause() for example if ( IsReallyPaused() ) { - wxLogTrace(TRACE_THREADS, _T("Waking up thread %ld"), (long)GetId()); - +#ifdef __VMS + wxLogTrace(TRACE_THREADS, _T("Waking up thread %ld"), (long long)GetId()); +#else + wxLogTrace(TRACE_THREADS, _T("Waking up thread %ld"), (long)GetId()); +#endif + // wake up Pause() m_semSuspend.Post(); @@ -914,7 +938,11 @@ void wxThreadInternal::Resume() else { wxLogTrace(TRACE_THREADS, _T("Thread %ld is not yet really paused"), +#ifdef __VMS + (long long)GetId()); +#else (long)GetId()); +#endif } SetState(STATE_RUNNING);