mutex lock issue

Apr 26, 2009 at 6:23am
What would happen if a thread try to delete an object which is locked by another thread (using pthread_mutex_lock) ???
Last edited on Apr 26, 2009 at 6:51am
Apr 26, 2009 at 9:06am
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.
Apr 27, 2009 at 10:19am
you cannot delete a locked mutex. simple..!!
Apr 27, 2009 at 10:48am
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.
Apr 27, 2009 at 5:32pm
Why do you want to destroy the mutex while the thread is still running?
Topic archived. No new replies allowed.