aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-04-05 03:52:34 +0200
committereldritch horrors <pennae@lix.systems>2024-04-05 20:13:02 +0000
commit52f741c23af84ebb67f7295600069a9c6e83aec4 (patch)
treed513b26ae32b09b235ccb367c1fbd04fb6020a8c /src/libutil
parent0b8a17cab6d47c0abf1f604b6dbc6dc92553ed15 (diff)
Revert "libutil: remove Pool::Handle::bad"
This reverts commit 792844fb861ea7367ac2316c78fec055363f2f9e. Change-Id: I3ca208b62edfd5cd1199478f75cd2edf19a364f6
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/pool.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libutil/pool.hh b/src/libutil/pool.hh
index 2f6d30130..b7a749e3a 100644
--- a/src/libutil/pool.hh
+++ b/src/libutil/pool.hh
@@ -103,6 +103,7 @@ public:
private:
Pool & pool;
std::shared_ptr<R> r;
+ bool bad = false;
friend Pool;
@@ -118,7 +119,7 @@ public:
if (!r) return;
{
auto state_(pool.state.lock());
- if (!std::uncaught_exceptions())
+ if (!bad && !std::uncaught_exceptions())
state_->idle.push_back(ref<R>(r));
assert(state_->inUse);
state_->inUse--;
@@ -128,6 +129,8 @@ public:
R * operator -> () { return &*r; }
R & operator * () { return *r; }
+
+ void markBad() { bad = true; }
};
Handle get()