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

    • Subcomponent:
    • Resolved In Build:
      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

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

              Dates

              Created:
              Updated:
              Resolved: