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

    • Bug
    • Resolution: Fixed
    • P3
    • 20
    • 19
    • hotspot
    • 19
    • b04
    • Fix failed

    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

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

                Dates

                  Created:
                  Updated:
                  Resolved: