# | Line 144 | Line 144 | public class CountDownLatch { | |
---|---|---|
144 | return getState(); | |
145 | } | |
146 | ||
147 | < | public int tryAcquireShared(int acquires) { |
147 | > | protected int tryAcquireShared(int acquires) { |
148 | return getState() == 0? 1 : -1; | |
149 | } | |
150 | ||
151 | < | public boolean tryReleaseShared(int releases) { |
151 | > | protected boolean tryReleaseShared(int releases) { |
152 | // Decrement count; signal when transition to zero | |
153 | for (;;) { | |
154 | int c = getState(); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |