Apr 26, 2009 at 6:23am Apr 26, 2009 at 6:23am UTC
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 6:51am UTC
Apr 26, 2009 at 9:06am Apr 26, 2009 at 9:06am UTC
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 Apr 27, 2009 at 10:19am UTC
you cannot delete a locked mutex. simple..!!
Apr 27, 2009 at 10:48am Apr 27, 2009 at 10:48am UTC
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 Apr 27, 2009 at 5:32pm UTC
Why do you want to destroy the mutex while the thread is still running?