HandshakeState should disallow suspend ops for disabler threads

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • 27
    • Affects Version/s: 27
    • Component/s: hotspot
    • In Review

      !!! In construction now !!!!

      HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool check_async_exception)

      could just skip a HandshakeOperation if the _handshakee->is_vthread_transition_disabler() returns true, so the same suspension temporary disabling mechanism would be used as for _handshakee->is_disable_suspend().

      The suggested fix is:

      diff --git a/src/hotspot/share/runtime/handshake.cpp b/src/hotspot/share/runtime/handshake.cpp
      index 89b02717a7a..360ef45bd07 100644
      --- a/src/hotspot/share/runtime/handshake.cpp
      +++ b/src/hotspot/share/runtime/handshake.cpp
      @@ -521,7 +521,7 @@ HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool che
         assert(_lock.owned_by_self(), "Lock must be held");
         assert(allow_suspend || !check_async_exception, "invalid case");
       #if INCLUDE_JVMTI
      - if (allow_suspend && _handshakee->is_disable_suspend()) {
      + if (allow_suspend && (_handshakee->is_disable_suspend() || _handshakee->is_vthread_transition_disabler())) {
           // filter out suspend operations while JavaThread is in disable_suspend mode
           allow_suspend = false;
         }

            Assignee:
            Serguei Spitsyn
            Reporter:
            Serguei Spitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: