From 281461f0f07b27253f39a96d1c576d5f410b5802 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 15 Feb 2019 18:33:58 +0100 Subject: [PATCH] nfs: work around assertion failure on exception during program init Closes #477 --- src/lib/nfs/Manager.cxx | 4 ++-- src/storage/plugins/NfsStorage.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/nfs/Manager.cxx b/src/lib/nfs/Manager.cxx index a4ebcc2ae..9fc34813b 100644 --- a/src/lib/nfs/Manager.cxx +++ b/src/lib/nfs/Manager.cxx @@ -73,7 +73,7 @@ NfsManager::Compare::operator()(const ManagedConnection &a, NfsManager::~NfsManager() noexcept { - assert(GetEventLoop().IsInside()); + assert(!GetEventLoop().IsAlive() || GetEventLoop().IsInside()); CollectGarbage(); @@ -103,7 +103,7 @@ NfsManager::GetConnection(const char *server, const char *export_name) noexcept void NfsManager::CollectGarbage() noexcept { - assert(GetEventLoop().IsInside()); + assert(!GetEventLoop().IsAlive() || GetEventLoop().IsInside()); garbage.clear_and_dispose(DeleteDisposer()); } diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index 346f9e6c2..5f9450497 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -192,7 +192,7 @@ private: } void Disconnect() noexcept { - assert(GetEventLoop().IsInside()); + assert(!GetEventLoop().IsAlive() || GetEventLoop().IsInside()); switch (state) { case State::INITIAL: