MCPcopy Create free account
hub / github.com/alibaba/MNN / enqueue

Method enqueue

transformers/llm/engine/src/httplib.h:884–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

882 ~ThreadPool() override = default;
883
884 bool enqueue(std::function<void()> fn) override {
885 {
886 std::unique_lock<std::mutex> lock(mutex_);
887 if (max_queued_requests_ > 0 && jobs_.size() >= max_queued_requests_) {
888 return false;
889 }
890 jobs_.push_back(std::move(fn));
891 }
892
893 cond_.notify_one();
894 return true;
895 }
896
897 void shutdown() override {
898 // Stop all worker threads...

Callers 2

httplib.hFile · 0.45
runMethod · 0.45

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by 1

runMethod · 0.36