More proper wait to use signals in mutex code