ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/SequenceLock.java
(Generate patch)

Comparing jsr166/src/jsr166e/SequenceLock.java (file contents):
Revision 1.6 by dl, Sun Jul 17 12:30:29 2011 UTC vs.
Revision 1.7 by dl, Sun Jul 17 15:07:11 2011 UTC

# Line 153 | Line 153 | public class SequenceLock implements Loc
153          }
154  
155          public final long tryAcquireShared(long unused) {
156 <            return ((getState() & 1L) == 0L ||
157 <                    getExclusiveOwnerThread() == Thread.currentThread()) ?
158 <                1L : -1L; // must return long
156 >            return (((getState() & 1L) == 0L) ? 1L :
157 >                    (getExclusiveOwnerThread() == Thread.currentThread()) ?  0L:
158 >                    -1L);
159          }
160  
161          public final boolean tryReleaseShared(long unused) {
162 <            return true;
162 >            return (getState() & 1L) == 0L;
163          }
164  
165          public final Condition newCondition() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines