Revert "libutil: remove Pool::Handle::bad"
This reverts commit 792844fb861ea7367ac2316c78fec055363f2f9e. Change-Id: I3ca208b62edfd5cd1199478f75cd2edf19a364f6
This commit is contained in:
parent
0b8a17cab6
commit
52f741c23a
2 changed files with 5 additions and 1 deletions
|
@ -155,6 +155,7 @@ void RemoteStore::setOptions(Connection & conn)
|
|||
RemoteStore::ConnectionHandle::~ConnectionHandle()
|
||||
{
|
||||
if (!daemonException && std::uncaught_exceptions()) {
|
||||
handle.markBad();
|
||||
debug("closing daemon connection because of an exception");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue