SWDEV-445415 - Pthread detach instead of pthread join
Detcah the thread which handle shutdown signals instead of joining
thread can avoid the segfault issue on specific ASIC.
Signed-off-by: Li Ma <li.ma@amd.com>
Change-Id: I74ac53c027ac370605caaa87115c83fd8027526a
[ROCm/rdc commit: ca569346a3]
이 커밋은 다음에 포함됨:
@@ -663,21 +663,19 @@ int main(int argc, char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Detach the thread, sys will recycle the resource
|
||||
thr_ret = pthread_detach(sig_listen_thread);
|
||||
// Don't fail if detach is not successful
|
||||
if (thr_ret !=0) {
|
||||
std::cerr << "Failed to detach ProcessSignalLoop. pthread_detach() returned " << thr_ret;
|
||||
}
|
||||
|
||||
// TODO(cfreehil): Eventually, set these by reading a config file
|
||||
rdc_server.set_start_rdc_admin_service(true);
|
||||
rdc_server.set_start_api_service(true);
|
||||
|
||||
rdc_server.Run();
|
||||
|
||||
// join the thread to prevent the program terminated
|
||||
void* ret = nullptr;
|
||||
thr_ret = pthread_join(sig_listen_thread, &ret);
|
||||
|
||||
// don't fail if it doesn't succeed
|
||||
if (thr_ret != 0) {
|
||||
std::cerr << "Failed to terminate ProcessSignalLoop. pthread_join() returned " << thr_ret;
|
||||
}
|
||||
|
||||
if (sShutDownServer) {
|
||||
std::cout << "RDC server successfully shut down." << std::endl;
|
||||
return 0;
|
||||
|
||||
새 이슈에서 참조
사용자 차단