summaryrefslogtreecommitdiffstats
path: root/game/shared/threading.hh
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-03-23 12:46:10 +0500
committeruntodesu <kirill@untode.su>2025-03-23 12:46:10 +0500
commitb2d4a09a5621e214636593641d9799b2b1cdcf72 (patch)
treefff28fa3816430a98efa1eabee82f22547f2056e /game/shared/threading.hh
parentef14e799b1ad590d42204f1c435915c4dc25bb9f (diff)
downloadvoxelius-b2d4a09a5621e214636593641d9799b2b1cdcf72.tar.bz2
voxelius-b2d4a09a5621e214636593641d9799b2b1cdcf72.zip
Slightly refactor threading API
- Hide away threading::submit overload that is meant to only be used with either a task that has been allocated using "new" or using a templated overload. Now it's called threading::detail::submit_new - Removed an unnecessary status check in mesher's Task::finalize impl
Diffstat (limited to 'game/shared/threading.hh')
-rw-r--r--game/shared/threading.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/game/shared/threading.hh b/game/shared/threading.hh
index e143f4f..083ccbf 100644
--- a/game/shared/threading.hh
+++ b/game/shared/threading.hh
@@ -28,9 +28,13 @@ namespace threading
void init(void);
void deinit(void);
void update(void);
-void submit(Task *task);
} // namespace threading
+namespace threading::detail
+{
+void submit_new(Task *task);
+} // namespace threading::detail
+
namespace threading
{
template<typename T, typename... AT>
@@ -40,7 +44,7 @@ void submit(AT &&... args);
template<typename T, typename... AT>
inline void threading::submit(AT &&... args)
{
- threading::submit(new T(args...));
+ threading::detail::submit_new(new T(args...));
}
#endif /* SHARED_THREADING_HH */