211 |
|
} |
212 |
|
|
213 |
|
/** |
214 |
< |
* Construct a <tt>Semaphore</tt> with the given number of |
214 |
> |
* Creates a <tt>Semaphore</tt> with the given number of |
215 |
|
* permits and nonfair fairness setting. |
216 |
|
* @param permits the initial number of permits available. This |
217 |
|
* value may be negative, in which case releases must |
222 |
|
} |
223 |
|
|
224 |
|
/** |
225 |
< |
* Construct a <tt>Semaphore</tt> with the given number of |
225 |
> |
* Creates a <tt>Semaphore</tt> with the given number of |
226 |
|
* permits and the given fairness setting. |
227 |
|
* @param permits the initial number of permits available. This |
228 |
|
* value may be negative, in which case releases must |
455 |
|
/** |
456 |
|
* Acquires the given number of permits from this semaphore, only |
457 |
|
* if all are available at the time of invocation. |
458 |
+ |
* |
459 |
|
* <p>Acquires the given number of permits, if they are available, and |
460 |
|
* returns immediately, with the value <tt>true</tt>, |
461 |
|
* reducing the number of available permits by the given amount. |
572 |
|
} |
573 |
|
|
574 |
|
/** |
575 |
< |
* Return the current number of permits available in this semaphore. |
575 |
> |
* Returns the current number of permits available in this semaphore. |
576 |
|
* <p>This method is typically used for debugging and testing purposes. |
577 |
|
* @return the number of permits available in this semaphore. |
578 |
|
*/ |
589 |
|
} |
590 |
|
|
591 |
|
/** |
592 |
< |
* Shrink the number of available permits by the indicated |
592 |
> |
* Shrinks the number of available permits by the indicated |
593 |
|
* reduction. This method can be useful in subclasses that use |
594 |
|
* semaphores to track resources that become unavailable. This |
595 |
|
* method differs from <tt>acquire</tt> in that it does not block |