Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
None
-
None
-
Low
Description
Problematic scenario:
1. two threads get blocked in SimpleCondition.await();
2. some thread calls SimpleCondition.signal();
3. one of blocked threads wakes up and runs;
4. spurious wakeup happens in the second thread and it wakes up too and runs even though nobody signaled it.
Thus this is a broken implementation of Condition interface.
Anyway, looking at how code uses it, SimpleCondition can just be replaced with CountDownLatch.