You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 47c3097
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -41,18 +41,21 @@
41
41
* <ol>
42
42
* <li>{@code init()}: captures the current {@link Context} and an {@link ContextContinuation} to
43
43
* prevent the enclosing context scope from completing early.
44
-
* <li>{@code run(Runnable)}: seeds the virtual thread's saved context once and retains its state
45
-
* in the continuation frame across park/unpark cycles.
44
+
* <li>On JDK 22 and later, {@code run(Runnable)} seeds the virtual thread's saved context once
45
+
* and retains its state in the continuation frame across park/unpark cycles.
46
46
* <li>{@code mount()} / {@code unmount()}: rebind and clear carrier-local profiler context. The
47
-
* state-backed swap path is retained when context listeners require per-mount notification.
47
+
* state-backed swap path is retained on JDK 21 and when context listeners require per-mount
48
+
* notification.
48
49
* <li>{@code afterDone()} / {@code afterTerminate()} for early VirtualThread support: cancels the
49
50
* help continuation, releasing the context scope to be closed.
50
51
* </ol>
51
52
*
52
-
* <p>{@code run(Runnable)} is the one-shot continuation body and executes after the first mount,
53
-
* when the current thread is the virtual thread. Its advice local is preserved with the
54
-
* continuation across yields. {@code runContinuation()} cannot serve this purpose because it
55
-
* executes once per mount and starts while the carrier is still the current thread.
53
+
* <p>On JDK 22 and later, {@code run(Runnable)} is the one-shot continuation body and executes
54
+
* after the first mount, when the current thread is the virtual thread. Its advice local is
55
+
* preserved with the continuation across yields. {@code runContinuation()} cannot serve this
56
+
* purpose because it executes once per mount and starts while the carrier is still the current
57
+
* thread. JDK 21 retains the per-mount path because this internal ordering differs across its
Copy file name to clipboardExpand all lines: dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/test/java/testdog/trace/instrumentation/java/lang/jdk21/VirtualThreadLifeCycleTest.java
0 commit comments