pipeline: Display error if joining thread failed

This can occur if a thread tries to call join on itself
This commit is contained in:
rdb 2022-12-03 21:48:34 +01:00
parent d6055cc927
commit 863a38e901

View File

@ -169,7 +169,12 @@ join() {
if (!_detached) { if (!_detached) {
_mutex.unlock(); _mutex.unlock();
void *return_val; 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; _detached = true;
return; return;
} }