Correct mutex implementation