From 863a38e90110bdca9776219b24f6858efa98245a Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 3 Dec 2022 21:48:34 +0100 Subject: [PATCH] pipeline: Display error if joining thread failed This can occur if a thread tries to call join on itself --- panda/src/pipeline/threadPosixImpl.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/panda/src/pipeline/threadPosixImpl.cxx b/panda/src/pipeline/threadPosixImpl.cxx index 371c7464ad..773061398e 100644 --- a/panda/src/pipeline/threadPosixImpl.cxx +++ b/panda/src/pipeline/threadPosixImpl.cxx @@ -169,7 +169,12 @@ join() { if (!_detached) { _mutex.unlock(); void *return_val; - pthread_join(_thread, &return_val); + int result = pthread_join(_thread, &return_val); + if (result != 0) { + thread_cat.error() + << "Failed to join thread " << _parent_obj->get_name() + << ": " << strerror(result) << "\n"; + } _detached = true; return; }