If I use mutex blocking like this
will the mutex be unblocked if the thread terminates inside the Send function?Code:pthread_mutex_lock (&send_mutex); try { Send( pBuffer, ulMsgSize ); } catch(...) { pthread_mutex_unlock (&send_mutex); throw; } pthread_mutex_unlock (&send_mutex);
I know with semaphores you can use the SEM_UNDO flag for that purpose, but how can you do it with mutexes?