MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / unload_all

Method unload_all

tools/server/server-models.cpp:728–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728void server_models::unload_all() {
729 std::vector<std::thread> to_join;
730 {
731 std::lock_guard<std::mutex> lk(mutex);
732 for (auto & [name, inst] : mapping) {
733 if (inst.meta.is_running()) {
734 SRV_INF("stopping model instance name=%s\n", name.c_str());
735 stopping_models.insert(name);
736 cv_stop.notify_all();
737 // status change will be handled by the managing thread
738 }
739 // moving the thread to join list to avoid deadlock
740 to_join.push_back(std::move(inst.th));
741 }
742 }
743 for (auto & th : to_join) {
744 if (th.joinable()) {
745 th.join();
746 }
747 }
748}
749
750void server_models::update_status(const std::string & name, server_model_status status, int exit_code) {
751 std::unique_lock<std::mutex> lk(mutex);

Callers 1

mainFunction · 0.80

Calls 3

is_runningMethod · 0.80
insertMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected