From f0cc06c7388acb32b86301965c5b2547e4e3b919 Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 13:51:50 +0500 Subject: Displace threading into core (qfortress graft) --- game/shared/threading.hh | 50 ------------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 game/shared/threading.hh (limited to 'game/shared/threading.hh') diff --git a/game/shared/threading.hh b/game/shared/threading.hh deleted file mode 100644 index 02903d5..0000000 --- a/game/shared/threading.hh +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef SHARED_THREADING_HH -#define SHARED_THREADING_HH 1 -#pragma once - -enum class task_status : unsigned int { - ENQUEUED = 0x0000U, - PROCESSING = 0x0001U, - COMPLETED = 0x0002U, - CANCELLED = 0x0004U, -}; - -class Task { -public: - virtual ~Task(void) = default; - virtual void process(void) = 0; - virtual void finalize(void) = 0; - - task_status get_status(void) const; - void set_status(task_status status); - -protected: - std::atomic m_status; - std::future m_future; -}; - -namespace threading -{ -void init(void); -void shutdown(void); -void update(void); -} // namespace threading - -namespace threading::detail -{ -void submit_new(Task* task); -} // namespace threading::detail - -namespace threading -{ -template -void submit(AT&&... args); -} // namespace threading - -template -inline void threading::submit(AT&&... args) -{ - threading::detail::submit_new(new T(args...)); -} - -#endif // SHARED_THREADING_HH -- cgit