about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/pool.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/pool.hh b/src/libutil/pool.hh
index 7033090020ef..0b142b0597c7 100644
--- a/src/libutil/pool.hh
+++ b/src/libutil/pool.hh
@@ -168,6 +168,16 @@ public:
     {
         return state.lock()->max;
     }
+
+    void flushBad()
+    {
+        auto state_(state.lock());
+        std::vector<ref<R>> left;
+        for (auto & p : state_->idle)
+            if (validator(p))
+                left.push_back(p);
+        std::swap(state_->idle, left);
+    }
 };
 
 }