diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2024-01-11 11:13:15 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2024-01-11 11:13:15 -0500 |
| commit | cce568a7f56861d6249d7445f51d0ed27c560a5c (patch) | |
| tree | dc16d597f2b5ba37935993add262bff28dc2ca44 /src/thread_pool.cpp | |
| parent | f07294ca65143fac8b1b426d1854212403721226 (diff) | |
checkpoint - mostly working condition after changes
Diffstat (limited to 'src/thread_pool.cpp')
| -rw-r--r-- | src/thread_pool.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index 4a67054..0fc9880 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -124,10 +124,11 @@ void inline PkeThreads_Shutdown_Inner(ThreadPool &tp) { tp.mutex.unlock(); } +void PkeThreads_Init() { + Buckets_Init(ThreadPool_BucketContainer, MAX_THREADS_PER_BUCKET); +} + ThreadPoolHandle PkeThreads_Init(uint8_t threadCount, uint8_t maxQueueCount, MemBucket *bkt) { - if (ThreadPool_BucketContainer.pkeHandle.hash == 0) { - Buckets_Init(ThreadPool_BucketContainer, MAX_THREADS_PER_BUCKET); - } assert(threadCount > 0); ThreadPoolHandle newHandle{Buckets_NewHandle(ThreadPool_BucketContainer)}; @@ -210,3 +211,7 @@ void PkeThreads_Teardown(ThreadPoolHandle handle) { tp->threads = CAFE_BABE(DynArray<std::thread>); tp->bkt = CAFE_BABE(MemBucket); } + +void PkeThreads_Teardown() { + Buckets_Destroy(ThreadPool_BucketContainer); +} |
