ezEngine  Milestone 9
ThreadUtils.h
1 #pragma once
2 
3 #include <Foundation/Basics.h>
4 #include <Foundation/Threading/Implementation/ThreadingDeclarations.h>
5 
6 struct ezTime;
7 
9 class EZ_FOUNDATION_DLL ezThreadUtils
10 {
11 public:
13  static void YieldTimeSlice();
14 
16  static void YieldHardwareThread();
17 
19  static void Sleep(const ezTime& duration); // [tested]
20 
22  static bool IsMainThread();
23 
25  static ezThreadID GetCurrentThreadID();
26 
27 private:
28  EZ_MAKE_SUBSYSTEM_STARTUP_FRIEND(Foundation, ThreadUtils);
29 
31  static void Initialize();
32 };
33 
Contains general thread functions.
Definition: ThreadUtils.h:9
The time class encapsulates a double value storing the time in seconds.
Definition: Time.h:10
#define EZ_MAKE_SUBSYSTEM_STARTUP_FRIEND(GroupName, SubsystemName)
This inserts a friend declaration into a class, such that the given group/subsystem can access privat...
Definition: StaticSubSystem.h:107