module; #include #include export module Core.Thread; export namespace Core { class Mutex final { std::mutex mutex{}; public: void lock() noexcept; void unlock() noexcept; }; class MutexGuard { Mutex& mutex; public: MutexGuard(Mutex& m); MutexGuard(const MutexGuard&) = delete; MutexGuard(MutexGuard&&) = delete; ~MutexGuard(); MutexGuard& operator=(const MutexGuard&) = delete; MutexGuard& operator=(MutexGuard&&) = delete; }; class Thread final { std::thread thread; public: using Function = void (*)(void*); Thread(); Thread(const Thread& other) = delete; Thread(Thread&& other) noexcept; ~Thread(); Thread& operator=(const Thread& other) = delete; Thread& operator=(Thread&& other) noexcept; void swap(Thread& other); bool start(Function f, void* p); bool join(); }; }