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