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

ObjectMonitor::is_busy() should return bool

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      generic
    • OS:
      generic

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: