aboutsummaryrefslogtreecommitdiff
path: root/src/thread_pool.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-02 12:28:38 +0000
committergingerBill <bill@gingerbill.org>2023-01-02 12:28:38 +0000
commit015fe924b8f9a1d8cb78d307a4f8ef6791402bea (patch)
tree244f74ef163f47c80475e47f36051e6f6a6fb7ce /src/thread_pool.cpp
parenta5ce8a8c0bc33afb6a4cf7baa16528c0a551d8e0 (diff)
Remove use of queues for procedure checking.
Diffstat (limited to 'src/thread_pool.cpp')
-rw-r--r--src/thread_pool.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp
index 9ac1af039..939d3c533 100644
--- a/src/thread_pool.cpp
+++ b/src/thread_pool.cpp
@@ -21,6 +21,10 @@ struct ThreadPool {
Futex tasks_left;
};
+gb_internal isize current_thread_index(void) {
+ return current_thread ? current_thread->idx : 0;
+}
+
gb_internal void thread_pool_init(ThreadPool *pool, gbAllocator const &a, isize thread_count, char const *worker_name) {
pool->allocator = a;
slice_init(&pool->threads, a, thread_count + 1);