ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/Semaphore.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/Semaphore.java (file contents):
Revision 1.12 by dl, Fri Sep 26 11:37:11 2003 UTC vs.
Revision 1.13 by dl, Sat Sep 27 12:22:40 2003 UTC

# Line 260 | Line 260 | public class Semaphore implements java.i
260       * less than or equal to zero, the method will not wait at all.
261       *
262       * @param timeout the maximum time to wait for a permit
263 <     * @param granularity the time unit of the <tt>timeout</tt> argument.
263 >     * @param unit the time unit of the <tt>timeout</tt> argument.
264       * @return <tt>true</tt> if a permit was acquired and <tt>false</tt>
265       * if the waiting time elapsed before a permit was acquired.
266       *
# Line 269 | Line 269 | public class Semaphore implements java.i
269       * @see Thread#interrupt
270       *
271       */
272 <    public boolean tryAcquire(long timeout, TimeUnit granularity)
272 >    public boolean tryAcquire(long timeout, TimeUnit unit)
273          throws InterruptedException {
274          lock.lockInterruptibly();
275 <        long nanos = granularity.toNanos(timeout);
275 >        long nanos = unit.toNanos(timeout);
276          try {
277              for (;;) {
278                  if (count > 0) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines