You are given a standard implementation of the wait-notify pattern.
Read about CountDownLatch and use the latch field to rewrite the body of the someMethod method.
Remove all unnecessary code from the class.
CountDownLatch
- 16
Locked
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Justin Smith
9 April 2022, 13:50
This task is actually really easy, I assume it's orange just because it has to do with a new class, but really, just follow the instructions literally. CountDownLatch seems really good to know about, and I hope we see it again in other tasks. The Oracle page has some really interesting implementations for it (the example in the task is really basic and doesn't give you a sense of the real power in this class): https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html
0