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

Comparing jsr166/src/main/java/util/concurrent/FairSemaphore.java (file contents):
Revision 1.4 by dl, Tue Jul 8 00:46:33 2003 UTC vs.
Revision 1.5 by dl, Wed Jul 9 23:23:17 2003 UTC

# Line 281 | Line 281 | public class FairSemaphore extends Semap
281       */
282      public void release(long permits) {
283          if (permits < 0) throw new IllegalArgumentException();
284 <        lock.lock();
284 >        // Even if using fair locks, releases should try to barge in.
285 >        if (!lock.tryLock())
286 >            lock.lock();
287          try {
288              count += permits;
289              for (int i = 0; i < permits; ++i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines