From 1fb98d21035005ca61add7638bfb2d65443b95bb Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Tue, 8 Nov 2016 07:37:23 +0100 Subject: [PATCH] Don't join worker instances but hard stop them --- src/anbox/runtime.cpp | 3 +-- src/anbox/runtime.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/anbox/runtime.cpp b/src/anbox/runtime.cpp index 41dac2da..58358b0f 100644 --- a/src/anbox/runtime.cpp +++ b/src/anbox/runtime.cpp @@ -77,8 +77,7 @@ void Runtime::stop() { service_.stop(); for (auto& worker : workers_) - if (worker.joinable()) - worker.join(); + pthread_kill(worker.native_handle(), SIGTERM); } std::function)> Runtime::to_dispatcher_functional() diff --git a/src/anbox/runtime.h b/src/anbox/runtime.h index 32dd684c..8eb5a836 100644 --- a/src/anbox/runtime.h +++ b/src/anbox/runtime.h @@ -48,8 +48,7 @@ public: // the size configured at creation time. void start(); - // stop cleanly shuts down a Runtime instance, - // joining all worker threads. + // stop cleanly shuts down a Runtime instance. void stop(); // to_dispatcher_functional returns a function for integration -- GitLab