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

Avoid direct or implicit Thread::current() calls when we already have a current thread variable

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 16
    • 16
    • hotspot
    • b09

    Description

      There are a number of API's which require the current thread and which will materialize it via Thread::current() if not passed in directly e.g.

      HandleMark hm;
      ResourceMark rm;
      JNIHandles::make_local(obj);

      but in many cases we already have the current thread accessible as THREAD and/or thread via *ENTRY wrappers or a TRAPS parameter, which we can pass directly e.g.

      HandleMark hm(THREAD);
      ResourceMark rm(THREAD);
      JNIHandles::make_local(THREAD, obj);

      Attachments

        Activity

          People

            coleenp Coleen Phillimore
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: