| 39 | } |
| 40 | |
| 41 | void thread_manager::save_thread(std::shared_ptr<std::thread> _thread) { |
| 42 | // Keep all dispatcher threads instead of handing over a single slot. Otherwise, if app_0 stores DT0 and then |
| 43 | // waits for app_1 to finish shutdown, app_1 can deadlock while trying to replace DT0 with DT1 under the same |
| 44 | // mutex. Preserving both entries lets interdependent applications complete shutdown without blocking the handover. |
| 45 | std::scoped_lock its_lock{this->thread_mutex_}; |
| 46 | thread_vector_.push_back(_thread); |
| 47 | } |
| 48 | } // namespace vsomeip_v3 |