mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8217618: JVM TI SuspendThread doesn't suspend the current thread before returning
Reviewed-by: dcubed, sspitsyn, dlong
This commit is contained in:
parent
49c91b7f95
commit
cb960e9a30
3 changed files with 37 additions and 23 deletions
|
@ -2392,8 +2392,19 @@ void JavaThread::java_suspend() {
|
|||
}
|
||||
}
|
||||
|
||||
VM_ThreadSuspend vm_suspend;
|
||||
VMThread::execute(&vm_suspend);
|
||||
if (Thread::current() == this) {
|
||||
// Safely self-suspend.
|
||||
// If we don't do this explicitly it will implicitly happen
|
||||
// before we transition back to Java, and on some other thread-state
|
||||
// transition paths, but not as we exit a JVM TI SuspendThread call.
|
||||
// As SuspendThread(current) must not return (until resumed) we must
|
||||
// self-suspend here.
|
||||
ThreadBlockInVM tbivm(this);
|
||||
java_suspend_self();
|
||||
} else {
|
||||
VM_ThreadSuspend vm_suspend;
|
||||
VMThread::execute(&vm_suspend);
|
||||
}
|
||||
}
|
||||
|
||||
// Part II of external suspension.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue