# | Line 212 | Line 212 | public class Semaphore implements java.i | |
---|---|---|
212 | } | |
213 | ||
214 | protected int tryAcquireShared(int acquires) { | |
215 | – | Thread current = Thread.currentThread(); |
215 | for (;;) { | |
216 | < | Thread first = getFirstQueuedThread(); |
218 | < | if (first != null && first != current) |
216 | > | if (hasQueuedPredecessors()) |
217 | return -1; | |
218 | int available = getState(); | |
219 | int remaining = available - acquires; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |