Loading...
Searching...
No Matches
ThreadImpl.hpp
Go to the documentation of this file.
#pragma once
#include "..\Platform.hpp"
#if defined(MCE_PLATFORM_LINUX) || defined(MCE_PLATFORM_MACOS)
#include <pthread.h>
#endif
namespace mce::core {
class Thread;
class ThreadImpl {
public:
ThreadImpl(Thread* owner);
#ifdef MCE_PLATFORM_WINDOWS
~ThreadImpl();
#endif
void wait();
void terminate();
bool isRunning() const;
private:
static unsigned int __stdcall entryPoint(void* userData);
#ifdef MCE_PLATFORM_WINDOWS
void* hThread;
unsigned int threadID;
#elif defined(MCE_PLATFORM_LINUX) || defined(MCE_PLATFORM_MACOS)
pthread_t thread;
bool isActive;
#endif
};
}
mce::core::Thread
Lightweight high-level thread wrapper.
Definition Thread.hpp:134
mce::core::ThreadImpl::terminate
void terminate()
Request termination of the associated thread.
mce::core::ThreadImpl::wait
void wait()
Block until the associated thread exits.
mce::core::ThreadImpl::ThreadImpl
ThreadImpl(Thread *owner)
Construct a ThreadImpl bound to its owner.