Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
pderop committed Apr 4, 2024
1 parent f182dea commit 826e1c4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions agent/src/main/java/reactor/blockhound/BlockHound.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public static class Builder {
put("java/lang/ProcessImpl", new HashMap<String, Set<String>>() {{
put("forkAndExec", singleton("(I[B[B[BI[BI[B[IZ)I"));
}});
} else {
}
else {
put("sun/misc/Unsafe", new HashMap<String, Set<String>>() {{
put("park", singleton("(ZJ)V"));
}});
Expand All @@ -219,14 +220,16 @@ public static class Builder {
put("yield", singleton("()V"));
put("onSpinWait", singleton("()V"));
}});
} else if (jdkMajorVersion >= 19 && jdkMajorVersion <= 21) {
}
else if (jdkMajorVersion >= 19 && jdkMajorVersion <= 21) {
// for jdk version in the range [19, 21], the native method for Thread.sleep is "sleep0"
put("java/lang/Thread", new HashMap<String, Set<String>>() {{
put("sleep0", singleton("(J)V"));
put("yield0", singleton("()V"));
put("onSpinWait", singleton("()V"));
}});
} else if (jdkMajorVersion > 21) {
}
else {
// for jdk version >= 22, the native method for Thread.sleep is "sleepNanos0"
put("java/lang/Thread", new HashMap<String, Set<String>>() {{
put("sleepNanos0", singleton("(J)V"));
Expand Down

0 comments on commit 826e1c4

Please sign in to comment.