# | Line 197 | Line 197 | public class Semaphore implements java.i | |
---|---|---|
197 | protected int tryAcquireShared(int acquires) { | |
198 | Thread current = Thread.currentThread(); | |
199 | for (;;) { | |
200 | < | if (!isFirst(current)) |
200 | > | Thread first = getFirstQueuedThread(); |
201 | > | if (first != null && first != current) |
202 | return -1; | |
203 | int available = getState(); | |
204 | int remaining = available - acquires; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |