109 |
|
private static final long serialVersionUID = 7373984872572414699L; |
110 |
|
|
111 |
|
static final class Sync extends AbstractQueuedLongSynchronizer { |
112 |
+ |
static final long serialVersionUID = 2540673546047039555L; |
113 |
+ |
|
114 |
|
/** |
115 |
|
* The number of times to spin in lock() and awaitAvailability(). |
116 |
|
*/ |
162 |
|
|
163 |
|
public final long tryAcquireShared(long unused) { |
164 |
|
return (((getState() & 1L) == 0L) ? 1L : |
165 |
< |
(getExclusiveOwnerThread() == Thread.currentThread()) ? 0L: |
165 |
> |
(getExclusiveOwnerThread() == Thread.currentThread()) ? 0L: |
166 |
|
-1L); |
167 |
|
} |
168 |
|
|
308 |
|
* @param timeout the time to wait for availability |
309 |
|
* @param unit the time unit of the timeout argument |
310 |
|
* @return the current sequence number if the lock is available |
311 |
< |
* upon return from this method. |
311 |
> |
* upon return from this method |
312 |
|
* @throws InterruptedException if the current thread is interrupted |
313 |
|
* @throws TimeoutException if the lock was not available within |
314 |
< |
* the specified waiting time. |
314 |
> |
* the specified waiting time |
315 |
|
* @throws NullPointerException if the time unit is null |
316 |
|
*/ |
317 |
|
public long tryAwaitAvailability(long timeout, TimeUnit unit) |
527 |
|
* @return the number of holds on this lock by the current thread, |
528 |
|
* or zero if this lock is not held by the current thread |
529 |
|
*/ |
530 |
< |
public long getHoldCount() { return sync.getHoldCount(); } |
530 |
> |
public long getHoldCount() { return sync.getHoldCount(); } |
531 |
|
|
532 |
|
/** |
533 |
|
* Queries if this lock is held by the current thread. |