Closed z5014823 closed 4 months ago
If there are no other waiting threads, it is unnecessary. Correct.
However, the unlock() method cannot know at that point if there are other threads waiting or not. There might be other threads waiting (because the state is 2), so it will call wake_one().
The content that the question is about
No response
The question
Isn't the final wake_one() call of the second thread redundant?