MCPcopy Create free account
hub / github.com/dobin/RedEdr / enqueue

Method enqueue

RedEdr/httplib.h:684–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682 ~ThreadPool() override = default;
683
684 bool enqueue(std::function<void()> fn) override {
685 {
686 std::unique_lock<std::mutex> lock(mutex_);
687 if (max_queued_requests_ > 0 && jobs_.size() >= max_queued_requests_) {
688 return false;
689 }
690 jobs_.push_back(std::move(fn));
691 }
692
693 cond_.notify_one();
694 return true;
695 }
696
697 void shutdown() override {
698 // Stop all worker threads...

Callers 1

httplib.hFile · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected