C
CJ
Hello Friends -
I've run across the following situation. I have two threads, say T1 and
T2 which access shared data - each locks a mutex before doing so.
Now I have a hard-to-find bug which means that periodically T1 gets
killed unexpectedly. But if it holds the mutex at that point, T2 blocks
for ever!
How can I get T1 to release any locks it's holding when it gets killed?
I've run across the following situation. I have two threads, say T1 and
T2 which access shared data - each locks a mutex before doing so.
Now I have a hard-to-find bug which means that periodically T1 gets
killed unexpectedly. But if it holds the mutex at that point, T2 blocks
for ever!
How can I get T1 to release any locks it's holding when it gets killed?