
29 Dec
2009
29 Dec
'09
6:11 p.m.
I know the correct answer is to avoid crashing while holding a mutex in shared memory ;-) But since I'm handing a system off to other developers I'd like to understand if there is a most correct way to 'scrub' a mutex in shared memory clean if a thread crashed while holding the mutex. Assume that at the point I would like to do this that there is only one thread attached to the shared memory and no possibility of any thread attempting to lock the (locked stagnant) mutex.