equal
deleted
inserted
replaced
151 } |
151 } |
152 } |
152 } |
153 // Acquire shared lock. |
153 // Acquire shared lock. |
154 // Return true if shared access is granted. |
154 // Return true if shared access is granted. |
155 inline bool sharedLock() { |
155 inline bool sharedLock() { |
156 jint res = Atomic::add(1, _lock); |
156 jint res = Atomic::add(_lock, 1); |
157 if (res < 0) { |
157 if (res < 0) { |
158 Atomic::dec(_lock); |
158 Atomic::dec(_lock); |
159 return false; |
159 return false; |
160 } |
160 } |
161 _lock_state = SharedLock; |
161 _lock_state = SharedLock; |