summaryrefslogtreecommitdiff
path: root/src/neighbor
diff options
context:
space:
mode:
Diffstat (limited to 'src/neighbor')
-rw-r--r--src/neighbor/plugins/SmbclientNeighborPlugin.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
index 2ccfcc1e2..3b7a8b069 100644
--- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
+++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
@@ -69,7 +69,8 @@ class SmbclientNeighborExplorer final : public NeighborExplorer {
public:
SmbclientNeighborExplorer(NeighborListener &_listener)
- :NeighborExplorer(_listener) {}
+ :NeighborExplorer(_listener),
+ thread(BIND_THIS_METHOD(ThreadFunc)) {}
/* virtual methods from class NeighborExplorer */
void Open() override;
@@ -79,14 +80,13 @@ public:
private:
void Run();
void ThreadFunc();
- static void ThreadFunc(void *ctx);
};
void
SmbclientNeighborExplorer::Open()
{
quit = false;
- thread.Start(ThreadFunc, this);
+ thread.Start();
}
void
@@ -239,6 +239,8 @@ SmbclientNeighborExplorer::Run()
inline void
SmbclientNeighborExplorer::ThreadFunc()
{
+ SetThreadName("smbclient");
+
mutex.lock();
while (!quit) {
@@ -257,15 +259,6 @@ SmbclientNeighborExplorer::ThreadFunc()
mutex.unlock();
}
-void
-SmbclientNeighborExplorer::ThreadFunc(void *ctx)
-{
- SetThreadName("smbclient");
-
- SmbclientNeighborExplorer &e = *(SmbclientNeighborExplorer *)ctx;
- e.ThreadFunc();
-}
-
static NeighborExplorer *
smbclient_neighbor_create(gcc_unused EventLoop &loop,
NeighborListener &listener,