< prev index next >

src/java.base/share/native/libjava/VirtualThread.c

Print this page

21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 
27 #include "jni.h"
28 #include "jvm.h"
29 #include "java_lang_VirtualThread.h"
30 
31 #define THREAD "Ljava/lang/Thread;"
32 #define VIRTUAL_THREAD  "Ljava/lang/VirtualThread;"
33 
34 static JNINativeMethod methods[] = {
35     { "notifyJvmtiStart",          "()V",  (void *)&JVM_VirtualThreadStart },
36     { "notifyJvmtiEnd",            "()V",  (void *)&JVM_VirtualThreadEnd },
37     { "notifyJvmtiMount",          "(Z)V", (void *)&JVM_VirtualThreadMount },
38     { "notifyJvmtiUnmount",        "(Z)V", (void *)&JVM_VirtualThreadUnmount },
39     { "notifyJvmtiHideFrames",     "(Z)V", (void *)&JVM_VirtualThreadHideFrames },
40     { "notifyJvmtiDisableSuspend", "(Z)V", (void *)&JVM_VirtualThreadDisableSuspend },


41 };
42 
43 JNIEXPORT void JNICALL
44 Java_java_lang_VirtualThread_registerNatives(JNIEnv *env, jclass clazz) {
45     (*env)->RegisterNatives(env, clazz, methods, (sizeof(methods)/sizeof(methods[0])));
46 }







21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 
27 #include "jni.h"
28 #include "jvm.h"
29 #include "java_lang_VirtualThread.h"
30 
31 #define THREAD "Ljava/lang/Thread;"
32 #define VIRTUAL_THREAD  "Ljava/lang/VirtualThread;"
33 
34 static JNINativeMethod methods[] = {
35     { "notifyJvmtiStart",          "()V",  (void *)&JVM_VirtualThreadStart },
36     { "notifyJvmtiEnd",            "()V",  (void *)&JVM_VirtualThreadEnd },
37     { "notifyJvmtiMount",          "(Z)V", (void *)&JVM_VirtualThreadMount },
38     { "notifyJvmtiUnmount",        "(Z)V", (void *)&JVM_VirtualThreadUnmount },
39     { "notifyJvmtiHideFrames",     "(Z)V", (void *)&JVM_VirtualThreadHideFrames },
40     { "notifyJvmtiDisableSuspend", "(Z)V", (void *)&JVM_VirtualThreadDisableSuspend },
41     { "setLockId",                 "(J)V", (void *)&JVM_SetLockId},
42     { "takeVirtualThreadListToUnblock", "()" VIRTUAL_THREAD, (void *)&JVM_TakeVirtualThreadListToUnblock},
43 };
44 
45 JNIEXPORT void JNICALL
46 Java_java_lang_VirtualThread_registerNatives(JNIEnv *env, jclass clazz) {
47     (*env)->RegisterNatives(env, clazz, methods, (sizeof(methods)/sizeof(methods[0])));
48 }
49 
50 JNIEXPORT void JNICALL
51 Java_java_lang_VirtualThread_virtualThreadPinnedEvent(JNIEnv *env, jclass ignored, jint reason)
52 {
53     JVM_VirtualThreadPinnedEvent(reason);
54 }
< prev index next >