Test: Remove unnecessary server_thread method
std::thread allows any callback signature so remove
the usual pthread void * foo(void *) wrapper when starting
the server thread.
Change-Id: I3b9e705da97258933a0c6b294c2c3bbdb8f98a27
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/test/test.cpp b/test/test.cpp
index cc9c3ee..07aaef7 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -20,15 +20,6 @@
#include <unistd.h>
#include <thread>
-auto server_thread(void* data)
-{
- auto mgr = static_cast<MainLoop*>(data);
-
- mgr->run();
-
- return static_cast<void*>(nullptr);
-}
-
void runTests(MainLoop& loop)
{
loop.shutdown();
@@ -47,7 +38,12 @@
sdbusplus::bus::new_default(),
dir,
"xyz.openbmc_project.Testing", "/testing");
- auto t = std::thread(server_thread, &loop);
+
+ auto threadMain = [](auto loop)
+ {
+ loop->run();
+ };
+ auto t = std::thread(threadMain, &loop);
runTests(loop);