mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-30 17:32:33 +00:00
Clear index requests upon "exit"
to make indexers stop in time. This is especially relevant when there are many initial index requests.
This commit is contained in:
parent
48f1a006b7
commit
962c0e72b4
@ -684,6 +684,14 @@ void mainLoop() {
|
||||
path2backlog[ex.path].push_back(&backlog.back());
|
||||
}
|
||||
|
||||
// If the "exit" notification has been received, clear all index requests
|
||||
// to make indexers stop in time.
|
||||
if (g_quit.load(std::memory_order_relaxed)) {
|
||||
index_request->apply([&](std::deque<IndexRequest> &q) {
|
||||
q.clear();
|
||||
});
|
||||
}
|
||||
|
||||
bool indexed = false;
|
||||
for (int i = 20; i--;) {
|
||||
std::optional<IndexUpdate> update = on_indexed->tryPopFront();
|
||||
|
Loading…
Reference in New Issue
Block a user