lib/nfs/FileReader: use nfs_get_event_loop()
Make sure we're using the same EventLoop as the NfsManager.
This commit is contained in:
parent
d4993c405e
commit
6d5904801e
@ -50,8 +50,7 @@ public:
|
|||||||
NfsInputStream(const char *_uri, Mutex &_mutex, Cond &_cond)
|
NfsInputStream(const char *_uri, Mutex &_mutex, Cond &_cond)
|
||||||
:AsyncInputStream(io_thread_get(), _uri, _mutex, _cond,
|
:AsyncInputStream(io_thread_get(), _uri, _mutex, _cond,
|
||||||
NFS_MAX_BUFFERED,
|
NFS_MAX_BUFFERED,
|
||||||
NFS_RESUME_AT),
|
NFS_RESUME_AT) {}
|
||||||
NfsFileReader(io_thread_get()) {}
|
|
||||||
|
|
||||||
virtual ~NfsInputStream() {
|
virtual ~NfsInputStream() {
|
||||||
DeferClose();
|
DeferClose();
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
NfsFileReader::NfsFileReader(EventLoop &event_loop)
|
NfsFileReader::NfsFileReader()
|
||||||
:DeferredMonitor(event_loop), state(State::INITIAL)
|
:DeferredMonitor(nfs_get_event_loop()), state(State::INITIAL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class NfsFileReader : NfsLease, NfsCallback, DeferredMonitor {
|
|||||||
nfsfh *fh;
|
nfsfh *fh;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NfsFileReader(EventLoop &event_loop);
|
NfsFileReader();
|
||||||
~NfsFileReader();
|
~NfsFileReader();
|
||||||
|
|
||||||
using DeferredMonitor::GetEventLoop;
|
using DeferredMonitor::GetEventLoop;
|
||||||
|
@ -48,7 +48,7 @@ nfs_finish()
|
|||||||
BlockingCall(nfs_glue->GetEventLoop(), [](){ nfs_glue.Destruct(); });
|
BlockingCall(nfs_glue->GetEventLoop(), [](){ nfs_glue.Destruct(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
Event_Loop &
|
EventLoop &
|
||||||
nfs_get_event_loop()
|
nfs_get_event_loop()
|
||||||
{
|
{
|
||||||
assert(in_use > 0);
|
assert(in_use > 0);
|
||||||
|
@ -36,7 +36,7 @@ nfs_finish();
|
|||||||
* Return the EventLoop that was passed to nfs_init().
|
* Return the EventLoop that was passed to nfs_init().
|
||||||
*/
|
*/
|
||||||
gcc_const
|
gcc_const
|
||||||
Event_Loop &
|
EventLoop &
|
||||||
nfs_get_event_loop();
|
nfs_get_event_loop();
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
|
Loading…
Reference in New Issue
Block a user