|
|
@ -62,9 +62,8 @@ class ThreadPoolInterface { |
|
|
|
// NULL closure.
|
|
|
|
// NULL closure.
|
|
|
|
class ThreadPoolWorker { |
|
|
|
class ThreadPoolWorker { |
|
|
|
public: |
|
|
|
public: |
|
|
|
ThreadPoolWorker(const char* thd_name, ThreadPoolInterface* pool, |
|
|
|
ThreadPoolWorker(const char* thd_name, MPMCQueueInterface* queue, |
|
|
|
MPMCQueueInterface* queue, Thread::Options& options, |
|
|
|
Thread::Options& options, int index) |
|
|
|
int index) |
|
|
|
|
|
|
|
: queue_(queue), thd_name_(thd_name), index_(index) { |
|
|
|
: queue_(queue), thd_name_(thd_name), index_(index) { |
|
|
|
thd_ = Thread(thd_name, |
|
|
|
thd_ = Thread(thd_name, |
|
|
|
[](void* th) { static_cast<ThreadPoolWorker*>(th)->Run(); }, |
|
|
|
[](void* th) { static_cast<ThreadPoolWorker*>(th)->Run(); }, |
|
|
|