From a3937e7eef97cb0badcd65c390b9dd39d4cfd094 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Fri, 22 Dec 2023 17:51:10 -0500 Subject: PkeThreads_Enqueue now takes a pointer to a task --- src/thread_pool.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/thread_pool.hpp') diff --git a/src/thread_pool.hpp b/src/thread_pool.hpp index dc75f33..a2c48f7 100644 --- a/src/thread_pool.hpp +++ b/src/thread_pool.hpp @@ -4,8 +4,6 @@ #include "dynamic-array.hpp" #include "macros.hpp" -#include -#include #include #include @@ -13,12 +11,13 @@ struct ThreadPoolHandle : public PkeHandle { }; constexpr ThreadPoolHandle ThreadPoolHandle_MAX = ThreadPoolHandle{}; -ThreadPoolHandle PkeThreads_Init (uint8_t threadCount, uint8_t maxQueueCount, MemBucket *bkt = nullptr); -void PkeThreads_Reset (ThreadPoolHandle handle); -bool PkeThreads_Enqueue (ThreadPoolHandle handle, std::packaged_task job); -void PkeThreads_Pause (ThreadPoolHandle handle); -void PkeThreads_Resume (ThreadPoolHandle handle); -void PkeThreads_Shutdown (ThreadPoolHandle handle); -void PkeThreads_Teardown (ThreadPoolHandle handle); +ThreadPoolHandle PkeThreads_Init (uint8_t threadCount, uint8_t maxQueueCount, MemBucket *bkt = nullptr); +void PkeThreads_Reset (ThreadPoolHandle handle); +bool PkeThreads_Enqueue (ThreadPoolHandle handle, std::packaged_task *job); +int64_t PkeThreads_GetQueueCount (ThreadPoolHandle handle); +void PkeThreads_Pause (ThreadPoolHandle handle); +void PkeThreads_Resume (ThreadPoolHandle handle); +void PkeThreads_Shutdown (ThreadPoolHandle handle); +void PkeThreads_Teardown (ThreadPoolHandle handle); #endif /* PKE_THREADING_HPP */ -- cgit v1.2.3