mutex lock issue

What would happen if a thread try to delete an object which is locked by another thread (using pthread_mutex_lock) ???
Last edited on
On a MS windows platform , mutex cannot lock any object...

When a mutex has been hold by someone thread(e.g. Thread A), any threads that attemping to hold this mutex will be hung until the mutex was released by Thread A.
you cannot delete a locked mutex. simple..!!
I am not sure how you can delete a mutex lock. probably you meant to say that you will use pthread_mutex_destroy on locked mutex.

It is safe to destroy an initialized mutex that is unlocked.
Attempting to destroy a locked mutex results in undefined behavior.
Why do you want to destroy the mutex while the thread is still running?
Topic archived. No new replies allowed.