
30 Dec
2009
30 Dec
'09
1:11 a.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.