diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-22 17:51:10 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-23 11:42:23 -0500 |
| commit | a3937e7eef97cb0badcd65c390b9dd39d4cfd094 (patch) | |
| tree | ca793f7630e0130211ed480c915968d743e7b506 /src/thread_pool.hpp | |
| parent | fa7fc343a0e444da72938fad58d219cf52228976 (diff) | |
PkeThreads_Enqueue now takes a pointer to a task
Diffstat (limited to 'src/thread_pool.hpp')
| -rw-r--r-- | src/thread_pool.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
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 <atomic> -#include <condition_variable> #include <cstdint> #include <future> @@ -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<void()> 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<void()> *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 */ |
