forked from lix-project/lix
Revert "libutil: remove Pool::Handle::bad"
This reverts commit792844fb86
. Change-Id:I3ca208b62edfd5cd1199478f75cd2edf19a364f6
This commit is contained in:
parent
b8099007d3
commit
b417838078
|
@ -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