This is not what I suggested. I suggested checking the stop flag after going through the acquire call. The thing you do in your code snippet you pasted here does nothing. Many things can happen between release() and wait().