diff --git a/source/bulkdata/t2eventreceiver.c b/source/bulkdata/t2eventreceiver.c index 32a2d019..426dfc2a 100644 --- a/source/bulkdata/t2eventreceiver.c +++ b/source/bulkdata/t2eventreceiver.c @@ -268,6 +268,11 @@ void* T2ER_EventDispatchThread(void *arg) if(ret != 0) // pthread cond wait failed return after unlock { T2Error("%s pthread_cond_wait failed with error code: %d\n", __FUNCTION__, ret); + if(pthread_mutex_unlock(&erMutex) != 0) + { + T2Error("%s pthread_mutex_unlock for erMutex failed\n", __FUNCTION__); + } + return NULL; } T2Debug("Received signal from T2ER_Push\n"); // Release erMutex before acquiring sTDMutex to avoid lock order reversal and potential deadlock