|
18 | 18 | #pragma once |
19 | 19 |
|
20 | 20 | #include <cstddef> |
21 | | -#include <memory> |
22 | | -#include <mutex> |
23 | 21 | #include <thread> |
24 | | -#include <cassert> |
25 | | - |
26 | | -#include <freebyrd/freebyrd.h> |
27 | 22 |
|
28 | 23 | /** |
29 | 24 | * @class FRBSingleton |
30 | | - * @brief Manages a global freebyrd thread pool instance for strip-based decompression. |
| 25 | + * @brief Stub — freebyrd thread pool has been removed. |
31 | 26 | * |
32 | | - * Mirrors the TFSingleton API so callers can swap between Taskflow and freebyrd pools. |
33 | | - * The pool is created lazily on first access or explicitly via create(). |
| 27 | + * Retains the API surface so that SchedulerFreebyrd and StripDecompressor |
| 28 | + * continue to compile, but all methods are no-ops. |
34 | 29 | */ |
35 | 30 | class FRBSingleton |
36 | 31 | { |
37 | 32 | public: |
38 | | - static void create(size_t numThreads) |
39 | | - { |
40 | | - std::lock_guard<std::mutex> lock(mutex_); |
41 | | - numThreads = numThreads ? numThreads : std::thread::hardware_concurrency(); |
42 | | - if(numThreads_ == numThreads && instance_) |
43 | | - return; |
44 | | - numThreads_ = numThreads; |
45 | | - instance_ = |
46 | | - std::make_unique<frb::thread_pool>(frb::pool_config{.num_threads = (uint32_t)numThreads_}); |
47 | | - } |
48 | | - |
49 | | - static frb::thread_pool& get() |
50 | | - { |
51 | | - std::lock_guard<std::mutex> lock(mutex_); |
52 | | - if(!instance_) |
53 | | - { |
54 | | - numThreads_ = std::thread::hardware_concurrency(); |
55 | | - instance_ = std::make_unique<frb::thread_pool>( |
56 | | - frb::pool_config{.num_threads = (uint32_t)numThreads_}); |
57 | | - } |
58 | | - assert(instance_); |
59 | | - return *instance_; |
60 | | - } |
61 | | - |
62 | | - static size_t num_threads() |
63 | | - { |
64 | | - std::lock_guard<std::mutex> lock(mutex_); |
65 | | - return numThreads_; |
66 | | - } |
67 | | - |
68 | | - static void destroy() |
69 | | - { |
70 | | - std::lock_guard<std::mutex> lock(mutex_); |
71 | | - instance_.reset(); |
72 | | - numThreads_ = 0; |
73 | | - } |
| 33 | + static void create(size_t) {} |
| 34 | + static size_t num_threads() { return std::thread::hardware_concurrency(); } |
| 35 | + static void destroy() {} |
74 | 36 |
|
75 | 37 | private: |
76 | 38 | FRBSingleton() = delete; |
77 | | - |
78 | | - static inline std::unique_ptr<frb::thread_pool> instance_ = nullptr; |
79 | | - static inline std::mutex mutex_; |
80 | | - static inline size_t numThreads_ = 0; |
81 | 39 | }; |
0 commit comments