Build
- Made pthreads usage conditional upon HAVE_LIBPTHREAD.
This commit is contained in:
@@ -40,26 +40,36 @@ Thread::~Thread ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Thread::start (void* inArg)
|
||||
{
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
mArg = inArg;
|
||||
return pthread_create (&mTID, NULL, (void*(*)(void*)) Thread::entryPoint, (void*) this);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Thread::wait ()
|
||||
{
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
pthread_join (mTID, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Thread::cancel ()
|
||||
{
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
pthread_cancel (mTID);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Thread::detach ()
|
||||
{
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
pthread_detach (mTID);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
#ifndef INCLUDED_THREAD
|
||||
#define INCLUDED_THREAD
|
||||
|
||||
#include <../auto.h>
|
||||
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
class Thread
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user