aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-30 12:04:47 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-11-30 12:04:47 +0000
commit31cf2ff1f1524a33dce67fd621bdd3b6e63b8acf (patch)
tree39de678c67704706b271c2e82c8e5212bf73968e /vespalib
parent5d618dc73dcf2c5948ab84b1e8e0fede7e57146a (diff)
Use lambda to avoid static member function.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/invokeserviceimpl.cpp7
-rw-r--r--vespalib/src/vespa/vespalib/util/invokeserviceimpl.h1
2 files changed, 1 insertions, 7 deletions
diff --git a/vespalib/src/vespa/vespalib/util/invokeserviceimpl.cpp b/vespalib/src/vespa/vespalib/util/invokeserviceimpl.cpp
index 0d83f50b8d7..1980e642b17 100644
--- a/vespalib/src/vespa/vespalib/util/invokeserviceimpl.cpp
+++ b/vespalib/src/vespa/vespalib/util/invokeserviceimpl.cpp
@@ -47,7 +47,7 @@ InvokeServiceImpl::registerInvoke(VoidFunc func) {
std::lock_guard guard(_lock);
_toWakeup.push_back(func);
if ( ! _thread) {
- _thread = std::make_unique<std::thread>(InvokeServiceImpl::run, this);
+ _thread = std::make_unique<std::thread>([this]() { runLoop(); });
}
return std::make_unique<Registration>(this, func);
}
@@ -80,10 +80,5 @@ InvokeServiceImpl::runLoop() {
}
-void
-InvokeServiceImpl::run(InvokeServiceImpl * service) {
- service->runLoop();
-}
-
}
diff --git a/vespalib/src/vespa/vespalib/util/invokeserviceimpl.h b/vespalib/src/vespa/vespalib/util/invokeserviceimpl.h
index 7dfadfd9973..f92cb691780 100644
--- a/vespalib/src/vespa/vespalib/util/invokeserviceimpl.h
+++ b/vespalib/src/vespa/vespalib/util/invokeserviceimpl.h
@@ -25,7 +25,6 @@ private:
class Registration;
void unregister(VoidFunc func);
void runLoop();
- static void run(InvokeServiceImpl *);
duration _naptime;
std::mutex _lock;
bool _closed;