From 8adbeda32a38246bd8deea9f6f718561b74e4e61 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 7 Sep 2004 12:38:10 +0000 Subject: [PATCH] Use DarwinThreadHelpers, remove mach stuff. --- stepmania/src/arch/Threads/Threads_Pthreads.cpp | 15 +++++---------- stepmania/src/arch/Threads/Threads_Pthreads.h | 6 +++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/stepmania/src/arch/Threads/Threads_Pthreads.cpp b/stepmania/src/arch/Threads/Threads_Pthreads.cpp index 1c46fb2438..8cd1517ea4 100644 --- a/stepmania/src/arch/Threads/Threads_Pthreads.cpp +++ b/stepmania/src/arch/Threads/Threads_Pthreads.cpp @@ -15,8 +15,7 @@ #endif #if defined(DARWIN) -#include -#include +#include "archutils/Darwin/DarwinThreadHelpers.h" #endif void ThreadImpl_Pthreads::Halt( bool Kill ) @@ -32,7 +31,7 @@ void ThreadImpl_Pthreads::Halt( bool Kill ) */ SuspendThread( pid ); #elif defined(DARWIN) - thread_suspend( MachThreadHandle ); + SuspendThread( MachThreadHandle ); #endif } @@ -42,7 +41,7 @@ void ThreadImpl_Pthreads::Resume() /* Send a SIGCONT to the thread. */ ResumeThread( pid ); #elif defined(DARWIN) - thread_resume( MachThreadHandle ); + ResumeThread( MachThreadHandle ); #endif } @@ -76,7 +75,7 @@ ThreadImpl *MakeThisThread() #endif #if defined(DARWIN) - thread->MachThreadHandle = mach_thread_self(); + thread->MachThreadHandle = GetCurrentThreadId(); #endif return thread; @@ -91,7 +90,7 @@ static void *StartThread( void *pData ) #endif #if defined(DARWIN) - pThis->MachThreadHandle = mach_thread_self(); + pThis->MachThreadHandle = GetCurrentThreadId(); #endif *pThis->m_piThreadID = pThis->GetThreadId(); @@ -222,11 +221,7 @@ void MutexImpl_Pthreads::Unlock() uint64_t GetThisThreadId() { -#if defined(PID_BASED_THREADS) return GetCurrentThreadId(); -#elif defined(DARWIN) - return (int) mach_thread_self(); -#endif } uint64_t GetInvalidThreadId() diff --git a/stepmania/src/arch/Threads/Threads_Pthreads.h b/stepmania/src/arch/Threads/Threads_Pthreads.h index 8a6195c1c7..154fddcf97 100644 --- a/stepmania/src/arch/Threads/Threads_Pthreads.h +++ b/stepmania/src/arch/Threads/Threads_Pthreads.h @@ -1,5 +1,5 @@ -#ifndef THREADS_WIN32_H -#define THREADS_WIN32_H +#ifndef THREADS_PTHREADS_H +#define THREADS_PTHREADS_H #include "Threads.h" @@ -23,7 +23,7 @@ public: #endif #if defined(DARWIN) - thread_act_t MachThreadHandle; + uint64_t MachThreadHandle; #endif /* These are only used during initialization. */