Skip to content

Commit aeb5680

Browse files
Mark the option EnableSignalHandling as immutable.
Add documentation to RuntimeOptionKeyFlag.
1 parent 798dd08 commit aeb5680

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/PosixUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public static void installSignalHandler(int signum, Signal.AdvancedSignalDispatc
302302
* signals.
303303
*/
304304
private static int sigaction(int signum, Signal.sigaction structSigAction, Signal.sigaction old) {
305-
VMError.guarantee(SubstrateOptions.EnableSignalHandling.getValue(), "Trying to install a signal handler while signal handling.");
305+
VMError.guarantee(SubstrateOptions.EnableSignalHandling.getValue(), "Trying to install a signal handler while signal handling is disabled.");
306306

307307
if (VMOperation.isInProgress()) {
308308
/*

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
790790
public static final HostedOptionKey<Boolean> DisableTypeIdResultVerification = new HostedOptionKey<>(true);
791791

792792
@Option(help = "Enables signal handling", stability = OptionStability.EXPERIMENTAL, type = Expert)//
793-
public static final RuntimeOptionKey<Boolean> EnableSignalHandling = new RuntimeOptionKey<>(null) {
793+
public static final RuntimeOptionKey<Boolean> EnableSignalHandling = new RuntimeOptionKey<>(null, Immutable) {
794794
@Override
795795
public Boolean getValueOrDefault(UnmodifiableEconomicMap<OptionKey<?>, Object> values) {
796796
if (values.containsKey(this)) {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RuntimeSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void initialize() {
104104

105105
/**
106106
* Adds a hook which will execute during the shutdown process. Note it is possible for the
107-
* {@link #shutdownHooks} to called without the {@link #startupHooks} executing first.
107+
* {@link #shutdownHooks} to be called without the {@link #startupHooks} executing first.
108108
*/
109109
@Platforms(Platform.HOSTED_ONLY.class)
110110
public void addShutdownHook(Hook hook) {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/RuntimeOptionKey.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.option;
2626

27-
import com.oracle.svm.core.SubstrateUtil;
28-
import com.oracle.svm.core.jdk.RuntimeSupport;
27+
import java.util.Objects;
28+
import java.util.function.Consumer;
29+
2930
import org.graalvm.collections.EconomicMap;
3031
import org.graalvm.compiler.api.replacements.Fold;
3132
import org.graalvm.compiler.options.Option;
@@ -34,8 +35,8 @@
3435
import org.graalvm.nativeimage.Platform;
3536
import org.graalvm.nativeimage.Platforms;
3637

37-
import java.util.Objects;
38-
import java.util.function.Consumer;
38+
import com.oracle.svm.core.SubstrateUtil;
39+
import com.oracle.svm.core.jdk.RuntimeSupport;
3940

4041
/**
4142
* Defines a runtime {@link Option}, in contrast to a {@link HostedOptionKey hosted option}.
@@ -133,7 +134,14 @@ private static int computeFlags(RuntimeOptionKeyFlag[] flags) {
133134
}
134135

135136
public enum RuntimeOptionKeyFlag {
137+
/** If this flag is set, then option value is propagated to all compilation isolates. */
136138
RelevantForCompilationIsolates,
139+
140+
/**
141+
* If this flag is set, then the option value can only be changed during startup, i.e.,
142+
* before the startup hooks are executed (see {@link RuntimeSupport#initialize()}). This
143+
* flag should be used for runtime options that are accessed in startup hooks.
144+
*/
137145
Immutable,
138146
}
139147
}

0 commit comments

Comments
 (0)