summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-14 15:31:49 +0100
committerMax Kellermann <max@duempel.org>2014-12-15 00:03:30 +0100
commit7fa91ec175452823e04dba199bc48df12d3a64f0 (patch)
tree66b63724c40237d58c46a5a879d98d8d534ca6d9 /src/lib
parent1d3a09d3770cb9b0f9018bd4ee68240fca5171fe (diff)
lib/nfs/Connection: add debug flag "in_destroy"
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/nfs/Connection.cxx6
-rw-r--r--src/lib/nfs/Connection.hxx5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index 56abf7129..4b6a6fc78 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -374,6 +374,11 @@ NfsConnection::DestroyContext()
assert(GetEventLoop().IsInside());
assert(context != nullptr);
+#ifndef NDEBUG
+ assert(!in_destroy);
+ in_destroy = true;
+#endif
+
/* cancel pending DeferredMonitor that was scheduled to notify
new leases */
DeferredMonitor::Cancel();
@@ -558,6 +563,7 @@ NfsConnection::MountInternal(Error &error)
#ifndef NDEBUG
in_service = false;
in_event = false;
+ in_destroy = false;
#endif
if (nfs_mount_async(context, server.c_str(), export_name.c_str(),
diff --git a/src/lib/nfs/Connection.hxx b/src/lib/nfs/Connection.hxx
index e47ba404b..310ccdc44 100644
--- a/src/lib/nfs/Connection.hxx
+++ b/src/lib/nfs/Connection.hxx
@@ -129,6 +129,11 @@ class NfsConnection : SocketMonitor, DeferredMonitor {
* event updates are omitted.
*/
bool in_event;
+
+ /**
+ * True when DestroyContext() is being called.
+ */
+ bool in_destroy;
#endif
bool mount_finished;