diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Threads/ThreadHelper.h |
Diffstat (limited to 'Runtime/Threads/ThreadHelper.h')
-rw-r--r-- | Runtime/Threads/ThreadHelper.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/Threads/ThreadHelper.h b/Runtime/Threads/ThreadHelper.h new file mode 100644 index 0000000..3e21538 --- /dev/null +++ b/Runtime/Threads/ThreadHelper.h @@ -0,0 +1,30 @@ +#ifndef THREADHELPER_H +#define THREADHELPER_H + +#if SUPPORT_THREADS + +#include "Thread.h" + +// ThreadHelper is typically implemented on a per-platform basis, as it contains OS +// specific functionality outside regular POSIX / pthread / WinAPI threads. + +class ThreadHelper +{ + friend class Thread; + friend class PlatformThread; + +protected: + static void Sleep(double time); + + static void SetThreadName(const Thread* thread); + static void SetThreadProcessor(const Thread* thread, int processor); + + static double GetThreadRunningTime(Thread::ThreadID thread); + +private: + ThreadHelper(); +}; + +#endif //SUPPORT_THREADS + +#endif |