diff --git a/src/input/plugins/NfsInputPlugin.cxx b/src/input/plugins/NfsInputPlugin.cxx index 3da7a19de..6a1fc1997 100644 --- a/src/input/plugins/NfsInputPlugin.cxx +++ b/src/input/plugins/NfsInputPlugin.cxx @@ -50,8 +50,7 @@ public: NfsInputStream(const char *_uri, Mutex &_mutex, Cond &_cond) :AsyncInputStream(io_thread_get(), _uri, _mutex, _cond, NFS_MAX_BUFFERED, - NFS_RESUME_AT), - NfsFileReader(io_thread_get()) {} + NFS_RESUME_AT) {} virtual ~NfsInputStream() { DeferClose(); diff --git a/src/lib/nfs/FileReader.cxx b/src/lib/nfs/FileReader.cxx index 69483873b..f248778f5 100644 --- a/src/lib/nfs/FileReader.cxx +++ b/src/lib/nfs/FileReader.cxx @@ -32,8 +32,8 @@ #include #include -NfsFileReader::NfsFileReader(EventLoop &event_loop) - :DeferredMonitor(event_loop), state(State::INITIAL) +NfsFileReader::NfsFileReader() + :DeferredMonitor(nfs_get_event_loop()), state(State::INITIAL) { } diff --git a/src/lib/nfs/FileReader.hxx b/src/lib/nfs/FileReader.hxx index 4a4d28930..4c3b80f7f 100644 --- a/src/lib/nfs/FileReader.hxx +++ b/src/lib/nfs/FileReader.hxx @@ -64,7 +64,7 @@ class NfsFileReader : NfsLease, NfsCallback, DeferredMonitor { nfsfh *fh; public: - NfsFileReader(EventLoop &event_loop); + NfsFileReader(); ~NfsFileReader(); using DeferredMonitor::GetEventLoop; diff --git a/src/lib/nfs/Glue.cxx b/src/lib/nfs/Glue.cxx index 290e30e0b..adea9d7b1 100644 --- a/src/lib/nfs/Glue.cxx +++ b/src/lib/nfs/Glue.cxx @@ -48,7 +48,7 @@ nfs_finish() BlockingCall(nfs_glue->GetEventLoop(), [](){ nfs_glue.Destruct(); }); } -Event_Loop & +EventLoop & nfs_get_event_loop() { assert(in_use > 0); diff --git a/src/lib/nfs/Glue.hxx b/src/lib/nfs/Glue.hxx index 24371a737..3606a908d 100644 --- a/src/lib/nfs/Glue.hxx +++ b/src/lib/nfs/Glue.hxx @@ -36,7 +36,7 @@ nfs_finish(); * Return the EventLoop that was passed to nfs_init(). */ gcc_const -Event_Loop & +EventLoop & nfs_get_event_loop(); gcc_pure