diff --git a/src/Thread.cpp b/src/Thread.cpp index 2de65ebf4..c2e79884f 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -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 } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/Thread.h b/src/Thread.h index 987585fd5..8c5a962f6 100644 --- a/src/Thread.h +++ b/src/Thread.h @@ -27,7 +27,11 @@ #ifndef INCLUDED_THREAD #define INCLUDED_THREAD +#include <../auto.h> + +#ifdef HAVE_LIBPTHREAD #include +#endif class Thread {