MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / enqueue

Method enqueue

external/httplib.h:764–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762 ~ThreadPool() override = default;
763
764 bool enqueue(std::function<void()> fn) override {
765 {
766 std::unique_lock<std::mutex> lock(mutex_);
767 if (max_queued_requests_ > 0 && jobs_.size() >= max_queued_requests_) {
768 return false;
769 }
770 jobs_.push_back(std::move(fn));
771 }
772
773 cond_.notify_one();
774 return true;
775 }
776
777 void shutdown() override {
778 // Stop all worker threads...

Callers 1

httplib.hFile · 0.80

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected