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

    • b09

      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);

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

              Created:
              Updated:
              Resolved: