JDK-8256301 : ObjectMonitor::is_busy() should return bool
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2020-11-12
  • Updated: 2021-06-07
  • Resolved: 2021-05-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b24Fixed
Related Reports
Relates :  
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
Comments
Changeset: fe333431 Author: Daniel D. Daugherty <dcubed@openjdk.org> Date: 2021-05-21 18:32:25 +0000 URL: https://git.openjdk.java.net/jdk/commit/fe333431c8c0f089e4fd55bf10903e1fba7fc6c4
21-05-2021

ObjectMonitor::is_busy() returned a set of bits that were used in diagnostic messages. When ObjectMonitor::is_busy_to_string() was added, the diagnostic messages switched to is_busy_to_string() and we no longer need the set of bits form.
20-05-2021

[~coleenp] - feel free to update the RFE's description as needed.
12-11-2020