summaryrefslogtreecommitdiffstats
path: root/game/shared/threading.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-06-25 00:44:36 +0500
committeruntodesu <kirill@untode.su>2025-06-25 00:44:36 +0500
commit88c01588aa0830e219eaa62588839e4d1e2883ce (patch)
tree602bb27dd3399aab4aae8c19630e3b7a8dac824b /game/shared/threading.cc
parent99cf6cca8dbbc1e563c10cf0167432d3d8af9783 (diff)
downloadvoxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.tar.bz2
voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.zip
Clang-format the entire source code
Diffstat (limited to 'game/shared/threading.cc')
-rw-r--r--game/shared/threading.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/game/shared/threading.cc b/game/shared/threading.cc
index 71c30e1..ad496ee 100644
--- a/game/shared/threading.cc
+++ b/game/shared/threading.cc
@@ -1,15 +1,16 @@
#include "shared/pch.hh"
+
#include "shared/threading.hh"
#include "core/cmdline.hh"
#include "core/constexpr.hh"
-constexpr static const char *DEFAULT_POOL_SIZE_ARG = "4";
+constexpr static const char* DEFAULT_POOL_SIZE_ARG = "4";
-static BS::light_thread_pool *thread_pool;
-static std::deque<Task *> task_deque;
+static BS::light_thread_pool* thread_pool;
+static std::deque<Task*> task_deque;
-static void task_process(Task *task)
+static void task_process(Task* task)
{
task->set_status(task_status::PROCESSING);
task->process();
@@ -41,11 +42,12 @@ void threading::init(void)
// Use the maximum available number of concurrent
// hardware threads provided by the implementation
thread_pool_size = num_concurrent_threads;
- }
- else {
- if(num_concurrent_threads)
+ } else {
+ if(num_concurrent_threads) {
thread_pool_size = cxpr::clamp<unsigned int>(std::strtoul(argument, nullptr, 10), 1U, num_concurrent_threads);
- else thread_pool_size = cxpr::max<unsigned int>(std::strtoul(argument, nullptr, 10), 1U);
+ } else {
+ thread_pool_size = cxpr::max<unsigned int>(std::strtoul(argument, nullptr, 10), 1U);
+ }
}
spdlog::info("threading: using {} threads for pooling tasks", thread_pool_size);
@@ -99,7 +101,7 @@ void threading::update(void)
}
}
-void threading::detail::submit_new(Task *task)
+void threading::detail::submit_new(Task* task)
{
task->set_status(task_status::ENQUEUED);