Skip to content

Commit 01a7805

Browse files
committed
try detaching thread
1 parent 92860d5 commit 01a7805

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test_package/main.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// This file is adapted from examples/modules/simple/main.cpp, but it runs the module
22
// service in a thread which is killed after two seconds. This is a workaround to conform with the
33
// expected format of a conan test package executable.
4-
#include <csignal>
5-
64
#include <iostream>
75
#include <memory>
86
#include <sstream>
@@ -106,9 +104,7 @@ int main(int argc, char** argv) try {
106104
std::thread t{[&my_mod] { my_mod->serve(); }};
107105
std::this_thread::sleep_for(std::chrono::seconds{2});
108106

109-
pthread_kill(t.native_handle(), SIGTERM);
110-
111-
t.join();
107+
t.detach();
112108

113109
return EXIT_SUCCESS;
114110
} catch (const viam::sdk::Exception& ex) {

0 commit comments

Comments
 (0)