Operating System - HP-UX
1819814 Members
4187 Online
109607 Solutions
New Discussion

pthread_mutex_unlock() causes my application to crash

 
Thu Nguyen_2
Advisor

pthread_mutex_unlock() causes my application to crash

We call pthread_mutex_unlock() and pass the address of a mutex (e.g pthread_mutex_unlock(&my_mutex). ) In the case that my_mutex got corrupted then my application will abort... Is there a way that we can check the validity of the mutex before we pass it to the system call pthread_mutex_unlock(). Thanks for your help on this one
1 REPLY 1
rick jones
Honored Contributor

Re: pthread_mutex_unlock() causes my application to crash

Checking the validity of a mutext would only be treating a symptom, not what would seem to be root-cause - which is the corruption of memory in the first place.

What would your application do upon discoving a corrupt mutex? How does it know that something else, even more critical was not corrupted?

So, it seems you would be best-off finding the source of the corruption and fixing it.
there is no rest for the wicked yet the virtuous have no pillows