src/hotspot/share/services/mallocSiteTable.hpp
changeset 59249 29b0d0b61615
parent 53685 df83034c9275
child 59290 97d13893ec3c
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
   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;