-
Type:
Enhancement
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 16
-
Component/s: hotspot
-
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);
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);