aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/nfs
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-14 15:20:40 +0100
committerMax Kellermann <max@duempel.org>2014-12-14 15:20:40 +0100
commitab4bb26a0aeac99a7ea5aa9fdd93d379bf3c054d (patch)
tree40767dd1ac991b5fa12ed4b5aac396575300bc14 /src/lib/nfs
parent4b8d258cff85678c7ac90c03e337f9316e1f7b98 (diff)
downloadmpd-ab4bb26a0aeac99a7ea5aa9fdd93d379bf3c054d.tar.gz
mpd-ab4bb26a0aeac99a7ea5aa9fdd93d379bf3c054d.tar.xz
mpd-ab4bb26a0aeac99a7ea5aa9fdd93d379bf3c054d.zip
lib/nfs/Connection: make in_service and in_event debug-only flags
Diffstat (limited to '')
-rw-r--r--src/lib/nfs/Connection.cxx9
-rw-r--r--src/lib/nfs/Connection.hxx2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index c57cb9b79..c62b11acb 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -407,17 +407,21 @@ NfsConnection::OnSocketReady(unsigned flags)
re-register it each time */
SocketMonitor::Steal();
+#ifndef NDEBUG
assert(!in_event);
in_event = true;
assert(!in_service);
in_service = true;
+#endif
int result = nfs_service(context, events_to_libnfs(flags));
+#ifndef NDEBUG
assert(context != nullptr);
assert(in_service);
in_service = false;
+#endif
while (!deferred_close.empty()) {
nfs_close_async(context, deferred_close.front(),
@@ -460,8 +464,10 @@ NfsConnection::OnSocketReady(unsigned flags)
closed = true;
}
+#ifndef NDEBUG
assert(in_event);
in_event = false;
+#endif
if (context != nullptr)
ScheduleSocket();
@@ -509,8 +515,11 @@ NfsConnection::MountInternal(Error &error)
postponed_mount_error.Clear();
mount_finished = false;
+
+#ifndef NDEBUG
in_service = false;
in_event = false;
+#endif
if (nfs_mount_async(context, server.c_str(), export_name.c_str(),
MountCallback, this) != 0) {
diff --git a/src/lib/nfs/Connection.hxx b/src/lib/nfs/Connection.hxx
index aebafd4d3..e63782931 100644
--- a/src/lib/nfs/Connection.hxx
+++ b/src/lib/nfs/Connection.hxx
@@ -111,6 +111,7 @@ class NfsConnection : SocketMonitor, DeferredMonitor {
Error postponed_mount_error;
+#ifndef NDEBUG
/**
* True when nfs_service() is being called.
*/
@@ -121,6 +122,7 @@ class NfsConnection : SocketMonitor, DeferredMonitor {
* event updates are omitted.
*/
bool in_event;
+#endif
bool mount_finished;