Skip to content
Closed
10 changes: 5 additions & 5 deletions src/java.base/share/classes/java/lang/VirtualThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ void unpark() {
submitRunContinuation();
}
} else if ((s == PINNED) || (s == TIMED_PINNED)) {
notifyJvmtiDisableSuspend(true);
try {
notifyJvmtiDisableSuspend(true);
// unpark carrier thread when pinned
synchronized (carrierThreadAccessLock()) {
Thread carrier = carrierThread;
Expand Down Expand Up @@ -849,8 +849,8 @@ boolean joinNanos(long nanos) throws InterruptedException {
public void interrupt() {
if (Thread.currentThread() != this) {
checkAccess();
notifyJvmtiDisableSuspend(true);
try {
notifyJvmtiDisableSuspend(true);
synchronized (interruptLock) {
interrupted = true;
Interruptible b = nioBlocker;
Expand Down Expand Up @@ -882,8 +882,8 @@ boolean getAndClearInterrupt() {
assert Thread.currentThread() == this;
boolean oldValue = interrupted;
if (oldValue) {
notifyJvmtiDisableSuspend(true);
try {
notifyJvmtiDisableSuspend(true);
synchronized (interruptLock) {
interrupted = false;
carrierThread.clearInterrupt();
Expand Down Expand Up @@ -913,8 +913,8 @@ Thread.State threadState() {
// runnable, not mounted
return Thread.State.RUNNABLE;
case RUNNING:
notifyJvmtiDisableSuspend(true);
try {
notifyJvmtiDisableSuspend(true);
// if mounted then return state of carrier thread
synchronized (carrierThreadAccessLock()) {
Thread carrierThread = this.carrierThread;
Expand Down Expand Up @@ -1038,8 +1038,8 @@ public String toString() {
sb.append("]/");
Thread carrier = carrierThread;
if (carrier != null) {
notifyJvmtiDisableSuspend(true);
try {
notifyJvmtiDisableSuspend(true);
// include the carrier thread state and name when mounted
synchronized (carrierThreadAccessLock()) {
carrier = carrierThread;
Expand Down