Minecraft Community Edition 0.1.0
Loading...
Searching...
No Matches
ThreadImpl.hpp
Go to the documentation of this file.
1#pragma once
2#include "..\Platform.hpp"
3#if defined(MCE_PLATFORM_LINUX) || defined(MCE_PLATFORM_MACOS)
4#include <pthread.h>
5#endif
6
14
15namespace mce::core {
22 class Thread;
23
32 class ThreadImpl {
33 public:
42
43#ifdef MCE_PLATFORM_WINDOWS
52#endif
53
60 void wait();
61
70 void terminate();
71
72
73 bool isRunning() const;
74 private:
75
84 static unsigned int __stdcall entryPoint(void* userData);
85
86#ifdef MCE_PLATFORM_WINDOWS
93 void* hThread;
94
100 unsigned int threadID;
101#elif defined(MCE_PLATFORM_LINUX) || defined(MCE_PLATFORM_MACOS)
107 pthread_t thread;
108
116 bool isActive;
117#endif
118 };
119}
Lightweight high-level thread wrapper.
Definition Thread.hpp:134
void terminate()
Request termination of the associated thread.
void wait()
Block until the associated thread exits.
ThreadImpl(Thread *owner)
Construct a ThreadImpl bound to its owner.