Fix virtual thread instrumentation for jdk 21 ea versions (#10887)

This commit is contained in:
Lauri Tulmin 2024-03-19 13:07:30 +02:00 committed by GitHub
parent 136781a6e0
commit 7635afe712
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ public class VirtualThreadInstrumentation implements TypeInstrumentation {
named("switchToCarrierThread").and(takesArguments(0)),
this.getClass().getName() + "$SwitchToCarrierAdvice");
transformer.applyAdviceToMethod(
named("switchToVirtualThread").and(takesArguments(1)),
// takes an extra argument in jdk 21 ea versions
named("switchToVirtualThread").and(takesArguments(1).or(takesArguments(2))),
this.getClass().getName() + "$SwitchToVirtualAdvice");
}