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

This commit is contained in:
Max Kellermann 2014-12-14 15:31:49 +01:00
parent 1d3a09d377
commit 7fa91ec175
2 changed files with 11 additions and 0 deletions

View File

@ -374,6 +374,11 @@ NfsConnection::DestroyContext()
assert(GetEventLoop().IsInside()); assert(GetEventLoop().IsInside());
assert(context != nullptr); assert(context != nullptr);
#ifndef NDEBUG
assert(!in_destroy);
in_destroy = true;
#endif
/* cancel pending DeferredMonitor that was scheduled to notify /* cancel pending DeferredMonitor that was scheduled to notify
new leases */ new leases */
DeferredMonitor::Cancel(); DeferredMonitor::Cancel();
@ -558,6 +563,7 @@ NfsConnection::MountInternal(Error &error)
#ifndef NDEBUG #ifndef NDEBUG
in_service = false; in_service = false;
in_event = false; in_event = false;
in_destroy = false;
#endif #endif
if (nfs_mount_async(context, server.c_str(), export_name.c_str(), if (nfs_mount_async(context, server.c_str(), export_name.c_str(),

View File

@ -129,6 +129,11 @@ class NfsConnection : SocketMonitor, DeferredMonitor {
* event updates are omitted. * event updates are omitted.
*/ */
bool in_event; bool in_event;
/**
* True when DestroyContext() is being called.
*/
bool in_destroy;
#endif #endif
bool mount_finished; bool mount_finished;