◆ worker()
| CPPHTTPLIB_NAMESPACE::ThreadPool::worker::worker |
( |
ThreadPool & | pool | ) |
|
|
inlineexplicit |
◆ operator()()
| void CPPHTTPLIB_NAMESPACE::ThreadPool::worker::operator() |
( |
| ) |
|
|
inline |
282424 {
282425 for (;;) {
282426 std::function<void()> fn;
282427 {
282428 duckdb::unique_lock<std::mutex> lock(pool_.mutex_);
282429
282430 pool_.cond_.wait(
282431 lock, [&] { return !pool_.jobs_.empty() || pool_.shutdown_; });
282432
282433 if (pool_.shutdown_ && pool_.jobs_.empty()) { break; }
282434
282435 fn = pool_.jobs_.front();
282436 pool_.jobs_.pop_front();
282437 }
282438
282439 assert(
true ==
static_cast<bool>(fn));
282440 fn();
282441 }
282442
282443#if defined(CPPHTTPLIB_OPENSSL_SUPPORT) && !defined(OPENSSL_IS_BORINGSSL) && \
282444 !defined(LIBRESSL_VERSION_NUMBER)
282445 OPENSSL_thread_stop();
282446#endif
282447 }
#define assert(x)
Definition duckdb.cpp:486071
The documentation for this struct was generated from the following file: