Out of Phase: Race Conditions and Shared Mutexes