// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Core/Types/BaseTypes.h" #include "Engine/Platform/Thread.h" /// /// Holds all created threads (except the main thread) /// class FLAXENGINE_API ThreadRegistry { public: /// /// Gets thread with given ID /// /// Thread ID /// Founded thread, or null if is missing static Thread* GetThread(uint64 id); /// /// Gets amount of threads in a registry /// /// The amount of threads used by the engine. static int32 Count(); /// /// Attempts to kill all threads. Also starts playing Metallica album Kill'Em All. Hit the Lights... /// static void KillEmAll(); public: static void Add(Thread* thread); static void Remove(Thread* thread); };