File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
internal-api/src/main/java/datadog/trace/util Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,12 @@ private void prepareWorkQueue() {
226226 } catch (final InterruptedException e ) {
227227 // ignore, we only want to preload queue internals
228228 }
229- // preload a future no-op task to ensure workQueue.take() will use await with timeout during
230- // premain - otherwise on Java 25 it will load ForkJoinPool which in turn loads ForkJoinTask,
231- // which then means we lose the chance to field-inject context into ForkJoinTask instances
232- workQueue .offer (FUTURE_NOOP_PLACEHOLDER );
229+ if (this == INSTANCE ) {
230+ // preload a future no-op task to ensure workQueue.take() will use await with timeout during
231+ // premain - otherwise on Java 25 it will load ForkJoinPool which in turn loads ForkJoinTask,
232+ // which then means we lose the chance to field-inject context into ForkJoinTask instances
233+ workQueue .offer (FUTURE_NOOP_PLACEHOLDER );
234+ }
233235 }
234236
235237 // for testing
You can’t perform that action at this time.
0 commit comments