Use DarwinThreadHelpers, remove mach stuff.
This commit is contained in:
@@ -15,8 +15,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
#include <mach/mach_init.h>
|
#include "archutils/Darwin/DarwinThreadHelpers.h"
|
||||||
#include <mach/thread_act.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ThreadImpl_Pthreads::Halt( bool Kill )
|
void ThreadImpl_Pthreads::Halt( bool Kill )
|
||||||
@@ -32,7 +31,7 @@ void ThreadImpl_Pthreads::Halt( bool Kill )
|
|||||||
*/
|
*/
|
||||||
SuspendThread( pid );
|
SuspendThread( pid );
|
||||||
#elif defined(DARWIN)
|
#elif defined(DARWIN)
|
||||||
thread_suspend( MachThreadHandle );
|
SuspendThread( MachThreadHandle );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +41,7 @@ void ThreadImpl_Pthreads::Resume()
|
|||||||
/* Send a SIGCONT to the thread. */
|
/* Send a SIGCONT to the thread. */
|
||||||
ResumeThread( pid );
|
ResumeThread( pid );
|
||||||
#elif defined(DARWIN)
|
#elif defined(DARWIN)
|
||||||
thread_resume( MachThreadHandle );
|
ResumeThread( MachThreadHandle );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +75,7 @@ ThreadImpl *MakeThisThread()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
thread->MachThreadHandle = mach_thread_self();
|
thread->MachThreadHandle = GetCurrentThreadId();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return thread;
|
return thread;
|
||||||
@@ -91,7 +90,7 @@ static void *StartThread( void *pData )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
pThis->MachThreadHandle = mach_thread_self();
|
pThis->MachThreadHandle = GetCurrentThreadId();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*pThis->m_piThreadID = pThis->GetThreadId();
|
*pThis->m_piThreadID = pThis->GetThreadId();
|
||||||
@@ -222,11 +221,7 @@ void MutexImpl_Pthreads::Unlock()
|
|||||||
|
|
||||||
uint64_t GetThisThreadId()
|
uint64_t GetThisThreadId()
|
||||||
{
|
{
|
||||||
#if defined(PID_BASED_THREADS)
|
|
||||||
return GetCurrentThreadId();
|
return GetCurrentThreadId();
|
||||||
#elif defined(DARWIN)
|
|
||||||
return (int) mach_thread_self();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t GetInvalidThreadId()
|
uint64_t GetInvalidThreadId()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef THREADS_WIN32_H
|
#ifndef THREADS_PTHREADS_H
|
||||||
#define THREADS_WIN32_H
|
#define THREADS_PTHREADS_H
|
||||||
|
|
||||||
#include "Threads.h"
|
#include "Threads.h"
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
thread_act_t MachThreadHandle;
|
uint64_t MachThreadHandle;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These are only used during initialization. */
|
/* These are only used during initialization. */
|
||||||
|
|||||||
Reference in New Issue
Block a user