Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256301

ObjectMonitor::is_busy() should return bool

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 16
    • hotspot
    • b24
    • generic
    • generic

      ObjectMonitor::is_busy() in src/hotspot/share/runtime/objectMonitor.hpp
      returns intptr_t:

        intptr_t is_busy() const {
          // TODO-FIXME: assert _owner == null implies _recursions = 0
          intptr_t ret_code = _waiters | intptr_t(_cxq) | intptr_t(_EntryList);
          if (contentions() > 0) {
            ret_code |= contentions();
          }
          if (_owner != DEFLATER_MARKER) {
            ret_code |= intptr_t(_owner);
          }
          return ret_code;
        }

      Generally, HotSpot style is that is_Foo() functions return bool
      so ObjectMonitor::is_busy() is an anomaly.

      This topic came during the discussion about:

          JDK-8253064 monitor list simplifications and getting rid of TSM

            dcubed Daniel Daugherty
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: