mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8249627: Degrade Thread.suspend and Thread.resume
Reviewed-by: cjplummer, sspitsyn, dholmes, jpai
This commit is contained in:
parent
bc12e9553d
commit
1abf971b93
15 changed files with 113 additions and 232 deletions
|
@ -3026,29 +3026,6 @@ JVM_ENTRY(jboolean, JVM_IsThreadAlive(JNIEnv* env, jobject jthread))
|
|||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY(void, JVM_SuspendThread(JNIEnv* env, jobject jthread))
|
||||
ThreadsListHandle tlh(thread);
|
||||
JavaThread* receiver = NULL;
|
||||
bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL);
|
||||
if (is_alive) {
|
||||
// jthread refers to a live JavaThread, but java_suspend() will
|
||||
// detect a thread that has started to exit and will ignore it.
|
||||
receiver->java_suspend();
|
||||
}
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY(void, JVM_ResumeThread(JNIEnv* env, jobject jthread))
|
||||
ThreadsListHandle tlh(thread);
|
||||
JavaThread* receiver = NULL;
|
||||
bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL);
|
||||
if (is_alive) {
|
||||
// jthread refers to a live JavaThread.
|
||||
receiver->java_resume();
|
||||
}
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY(void, JVM_SetThreadPriority(JNIEnv* env, jobject jthread, jint prio))
|
||||
ThreadsListHandle tlh(thread);
|
||||
oop java_thread = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue