MCPcopy Create free account
hub / github.com/apache/trafficserver / ~ThreadPool

Method ~ThreadPool

plugins/experimental/magick/magick.cc:92–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 std::condition_variable semaphore_;
91
92 ~ThreadPool()
93 {
94 assert(running_);
95 running_ = false;
96
97 Lock lock(mutex_);
98
99 queue_.clear();
100
101 semaphore_.notify_all();
102
103 assert(nullptr != pool_);
104 for (size_t i = 0; i < size_; ++i) {
105 TSThread thread = pool_[i];
106 assert(nullptr != thread);
107 Dbg(dbg_ctl, "Destroying thread number %lu (%p)", i, thread);
108 TSThreadWait(thread);
109 TSThreadDestroy(thread);
110 }
111
112 delete[] pool_;
113 const_cast<TSThread *&>(pool_) = nullptr;
114 }
115
116 ThreadPool(const size_t s) : size_(s), running_(true), pool_(new TSThread[s])
117 {

Callers

nothing calls this directly

Calls 3

TSThreadWaitFunction · 0.85
TSThreadDestroyFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected