libutil: remove Pool::Handle::bad

it was used incorrectly (not swapped on handle move), only used in one
place (that is now handled with exception handling detection in Handle
itself), and if ever reintroduced should be replaced with a different,
more understandable mechanism (like an explicit dropAsInvalid method).

Change-Id: Ie3e5d5cfa81d335429cb2ee5c3ad85c74a9df17b
This commit is contained in:
eldritch horrors 2024-03-21 21:35:27 +01:00
parent 614b20f09c
commit 792844fb86
2 changed files with 1 additions and 5 deletions

View file

@ -155,7 +155,6 @@ void RemoteStore::setOptions(Connection & conn)
RemoteStore::ConnectionHandle::~ConnectionHandle()
{
if (!daemonException && std::uncaught_exceptions()) {
handle.markBad();
debug("closing daemon connection because of an exception");
}
}

View file

@ -103,7 +103,6 @@ public:
private:
Pool & pool;
std::shared_ptr<R> r;
bool bad = false;
friend Pool;
@ -119,7 +118,7 @@ public:
if (!r) return;
{
auto state_(pool.state.lock());
if (!bad && !std::uncaught_exceptions())
if (!std::uncaught_exceptions())
state_->idle.push_back(ref<R>(r));
assert(state_->inUse);
state_->inUse--;
@ -129,8 +128,6 @@ public:
R * operator -> () { return &*r; }
R & operator * () { return *r; }
void markBad() { bad = true; }
};
Handle get()