Skip to content

Commit a4e4f3d

Browse files
Fixes after rebasing.
1 parent dd7e8b1 commit a4e4f3d

File tree

2 files changed

+3
-11
lines changed
  • substratevm/src

2 files changed

+3
-11
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.lang.ref.Reference;
3131

3232
import com.oracle.svm.core.thread.JavaThreads;
33+
import com.oracle.svm.core.thread.PlatformThreads;
3334
import org.graalvm.compiler.api.replacements.Fold;
3435
import org.graalvm.nativeimage.CurrentIsolate;
3536
import org.graalvm.nativeimage.IsolateThread;
@@ -1058,7 +1059,7 @@ private void finishCollection() {
10581059

10591060
// This method will be removed as soon as possible, see GR-36676.
10601061
static void doReferenceHandlingInRegularThread() {
1061-
if (ReferenceHandler.useRegularJavaThread() && !VMOperation.isInProgress() && JavaThreads.currentJavaThreadInitialized()) {
1062+
if (ReferenceHandler.useRegularJavaThread() && !VMOperation.isInProgress() && PlatformThreads.isCurrentAssigned()) {
10621063
doReferenceHandling();
10631064
}
10641065
}
@@ -1070,7 +1071,7 @@ static void doReferenceHandlingInRegularThread() {
10701071
*/
10711072
static void doReferenceHandling() {
10721073
assert !VMOperation.isInProgress() : "could result in deadlocks";
1073-
assert JavaThreads.currentJavaThreadInitialized() : "thread is not fully initialized yet";
1074+
assert PlatformThreads.isCurrentAssigned() : "thread is not fully initialized yet";
10741075
/* Most of the time, we won't have a pending reference list. So, we do that check first. */
10751076
if (HeapImpl.getHeapImpl().hasReferencePendingListUnsafe()) {
10761077
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)