From d4993c405e73f299bd8db39b1f9d23e08881b356 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Jan 2017 09:19:25 +0100 Subject: [PATCH] lib/nfs/Glue: add EventLoop& accessor --- src/lib/nfs/Glue.cxx | 8 ++++++++ src/lib/nfs/Glue.hxx | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/nfs/Glue.cxx b/src/lib/nfs/Glue.cxx index be82bd855..290e30e0b 100644 --- a/src/lib/nfs/Glue.cxx +++ b/src/lib/nfs/Glue.cxx @@ -48,6 +48,14 @@ nfs_finish() BlockingCall(nfs_glue->GetEventLoop(), [](){ nfs_glue.Destruct(); }); } +Event_Loop & +nfs_get_event_loop() +{ + assert(in_use > 0); + + return nfs_glue->GetEventLoop(); +} + NfsConnection & nfs_get_connection(const char *server, const char *export_name) { diff --git a/src/lib/nfs/Glue.hxx b/src/lib/nfs/Glue.hxx index d83daf37e..24371a737 100644 --- a/src/lib/nfs/Glue.hxx +++ b/src/lib/nfs/Glue.hxx @@ -32,6 +32,13 @@ nfs_init(EventLoop &event_loop); void nfs_finish(); +/** + * Return the EventLoop that was passed to nfs_init(). + */ +gcc_const +Event_Loop & +nfs_get_event_loop(); + gcc_pure NfsConnection & nfs_get_connection(const char *server, const char *export_name);