< prev index next >

src/hotspot/share/runtime/objectMonitor.inline.hpp

Print this page

        

@@ -93,10 +93,14 @@
 // return number of threads contending for this monitor
 inline jint ObjectMonitor::contentions() const {
   return _contentions;
 }
 
+// Do NOT set _contentions = 0. There is a race such that _contentions could
+// be set while inflating prior to setting _owner
+// Just use Atomic::inc/dec and assert 0 when monitor put on free list
 inline void ObjectMonitor::set_owner(void* owner) {
   _owner = owner;
+  _recursions = 0;
 }
 
 #endif // SHARE_RUNTIME_OBJECTMONITOR_INLINE_HPP
< prev index next >