diff --git a/src/main/java/org/jboss/threads/EnhancedQueueExecutor.java b/src/main/java/org/jboss/threads/EnhancedQueueExecutor.java index fa1b29b..3ce0b00 100644 --- a/src/main/java/org/jboss/threads/EnhancedQueueExecutor.java +++ b/src/main/java/org/jboss/threads/EnhancedQueueExecutor.java @@ -322,7 +322,10 @@ public final class EnhancedQueueExecutor extends AbstractExecutorService impleme private static final long activeCountOffset; private static final long peakQueueSizeOffset; - // GraalVM should initialize this class at run time + // GraalVM should initialize this class at run time, which we instruct it to do in + // src/main/resources/META-INF/native-image/org.jboss.threads/jboss-threads/native-image.properties + // Please make sure to update that file if you remove or rename this class, or if runtime + // initialization is no longer needed private static final class RuntimeFields { private static final int unsharedTaskNodesSize; private static final int unsharedLongsSize; diff --git a/src/main/resources/META-INF/native-image/org.jboss.threads/jboss-threads/native-image.properties b/src/main/resources/META-INF/native-image/org.jboss.threads/jboss-threads/native-image.properties new file mode 100644 index 0000000..3fb49b2 --- /dev/null +++ b/src/main/resources/META-INF/native-image/org.jboss.threads/jboss-threads/native-image.properties @@ -0,0 +1 @@ +Args = --initialize-at-run-time=org.jboss.threads.EnhancedQueueExecutor$RuntimeFields