Commit 7fa91ec1 authored by Max Kellermann's avatar Max Kellermann

lib/nfs/Connection: add debug flag "in_destroy"

parent 1d3a09d3
......@@ -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(),
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment