MT#63171 AmThreadWatcher: stop thread

When the thread watcher itself is in stopping state, request all watched
threads to also stop.

Change-Id: I964ba89519c1d8150756ef2688bb4b7c20be45c6
mr13.5
Richard Fuchs 1 year ago
parent 9270717e82
commit 2245d597de

@ -169,7 +169,7 @@ void AmThreadWatcher::run()
while (!stop_requested_unlocked() || !thread_list.empty()) {
run_cond.wait_for(_l, std::chrono::seconds(10));
run_cond.wait_for(_l, std::chrono::seconds(1));
DBG("Thread watcher starting its work\n");
@ -180,7 +180,14 @@ void AmThreadWatcher::run()
AmThread* cur_thread = *it;
_l.unlock();
DBG("thread %lu is to be processed in thread watcher.\n", cur_thread->_pid);
if (stop_requested()) {
DBG("thread watcher requesting thread %lu to stop.\n", cur_thread->_pid);
cur_thread->stop();
}
if(cur_thread->is_stopped()){
DBG("thread %lu has been destroyed.\n", cur_thread->_pid);
cur_thread->join();

Loading…
Cancel
Save