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

adjust guarantee in Handshake::execute for the case of target thread being current

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 19
    • Fix Version/s: 20
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      19
    • Resolved In Build:
      master

      Backports

        Description

        The following guarantee in Handshake::execute has to be adjusted for the case of target thread being current:
        void Handshake::execute(HandshakeClosure* hs_cl, ThreadsListHandle* tlh, JavaThread* target) {
          . . .
          if (tlh == nullptr) {
            guarantee(Thread::is_JavaThread_protected_by_TLH(target),
                      "missing ThreadsListHandle in calling context.");

        It has to be similar to the following async Handshake::execute version:

        void Handshake::execute(AsyncHandshakeClosure* hs_cl, JavaThread* target) {
          jlong start_time_ns = os::javaTimeNanos();
          AsyncHandshakeOperation* op = new AsyncHandshakeOperation(hs_cl, target, start_time_ns);

          guarantee(target != nullptr, "must be");

          Thread* current = Thread::current();
          if (current != target) {
            // Another thread is handling the request and it must be protecting
            // the target.
            guarantee(Thread::is_JavaThread_protected_by_TLH(target),
                      "missing ThreadsListHandle in calling context.");
          }

        Also, please, refer to the comments from David on the related bug JDK-8286960

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jsjolen Johan Sjölen
                Reporter:
                sspitsyn Serguei Spitsyn
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: