forked from lix-project/lix
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:
parent
4556892c17
commit
7f94f986d4
|
@ -155,7 +155,6 @@ void RemoteStore::setOptions(Connection & conn)
|
||||||
RemoteStore::ConnectionHandle::~ConnectionHandle()
|
RemoteStore::ConnectionHandle::~ConnectionHandle()
|
||||||
{
|
{
|
||||||
if (!daemonException && std::uncaught_exceptions()) {
|
if (!daemonException && std::uncaught_exceptions()) {
|
||||||
handle.markBad();
|
|
||||||
debug("closing daemon connection because of an exception");
|
debug("closing daemon connection because of an exception");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,6 @@ public:
|
||||||
private:
|
private:
|
||||||
Pool & pool;
|
Pool & pool;
|
||||||
std::shared_ptr<R> r;
|
std::shared_ptr<R> r;
|
||||||
bool bad = false;
|
|
||||||
|
|
||||||
friend Pool;
|
friend Pool;
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ public:
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
{
|
{
|
||||||
auto state_(pool.state.lock());
|
auto state_(pool.state.lock());
|
||||||
if (!bad && !std::uncaught_exceptions())
|
if (!std::uncaught_exceptions())
|
||||||
state_->idle.push_back(ref<R>(r));
|
state_->idle.push_back(ref<R>(r));
|
||||||
assert(state_->inUse);
|
assert(state_->inUse);
|
||||||
state_->inUse--;
|
state_->inUse--;
|
||||||
|
@ -129,8 +128,6 @@ public:
|
||||||
|
|
||||||
R * operator -> () { return &*r; }
|
R * operator -> () { return &*r; }
|
||||||
R & operator * () { return *r; }
|
R & operator * () { return *r; }
|
||||||
|
|
||||||
void markBad() { bad = true; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle get()
|
Handle get()
|
||||||
|
|
Loading…
Reference in a new issue