Skip to content

Commit 9459b86

Browse files
Fixes after rebasing.
1 parent dd7e8b1 commit 9459b86

File tree

2 files changed

+3
-12
lines changed
  • substratevm/src

2 files changed

+3
-12
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/GCImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import java.lang.ref.Reference;
3131

32-
import com.oracle.svm.core.thread.JavaThreads;
3332
import org.graalvm.compiler.api.replacements.Fold;
3433
import org.graalvm.nativeimage.CurrentIsolate;
3534
import org.graalvm.nativeimage.IsolateThread;
@@ -85,6 +84,7 @@
8584
import com.oracle.svm.core.thread.JavaVMOperation;
8685
import com.oracle.svm.core.thread.NativeVMOperation;
8786
import com.oracle.svm.core.thread.NativeVMOperationData;
87+
import com.oracle.svm.core.thread.PlatformThreads;
8888
import com.oracle.svm.core.thread.VMOperation;
8989
import com.oracle.svm.core.thread.VMThreads;
9090
import com.oracle.svm.core.util.TimeUtils;
@@ -1058,7 +1058,7 @@ private void finishCollection() {
10581058

10591059
// This method will be removed as soon as possible, see GR-36676.
10601060
static void doReferenceHandlingInRegularThread() {
1061-
if (ReferenceHandler.useRegularJavaThread() && !VMOperation.isInProgress() && JavaThreads.currentJavaThreadInitialized()) {
1061+
if (ReferenceHandler.useRegularJavaThread() && !VMOperation.isInProgress() && PlatformThreads.isCurrentAssigned()) {
10621062
doReferenceHandling();
10631063
}
10641064
}
@@ -1070,7 +1070,7 @@ static void doReferenceHandlingInRegularThread() {
10701070
*/
10711071
static void doReferenceHandling() {
10721072
assert !VMOperation.isInProgress() : "could result in deadlocks";
1073-
assert JavaThreads.currentJavaThreadInitialized() : "thread is not fully initialized yet";
1073+
assert PlatformThreads.isCurrentAssigned() : "thread is not fully initialized yet";
10741074
/* Most of the time, we won't have a pending reference list. So, we do that check first. */
10751075
if (HeapImpl.getHeapImpl().hasReferencePendingListUnsafe()) {
10761076
long startTime = System.nanoTime();

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceHandler.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ static void processCleaners() {
9191
}
9292
}
9393

94-
public static boolean isReferenceHandlingAllowed() {
95-
/*
96-
* Inside a VMOperation, we are not allowed to do certain things, e.g., perform
97-
* synchronization (because it can deadlock when a lock is held outside the VMOperation).
98-
* Similar restrictions apply if we are too early in the attach sequence of a thread.
99-
*/
100-
return !VMOperation.isInProgress() && JavaThreads.currentJavaThreadInitialized();
101-
}
102-
10394
private ReferenceHandler() {
10495
}
10596
}

0 commit comments

Comments
 (0)