Also, casting this seems wrong. mutex has a 'load' function for receiving the value. Another commit suggests that the mutex may be completely unnecessary though.
Is the if statement correct in checking that the mutex exists or does it need the value as well?