Skip to content

Commit

Permalink
Add support for AutoShutdownDelegatedExecutorService
Browse files Browse the repository at this point in the history
This executor is returned by `Executors#newSingleThreadExecutor` under Java 21.

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro authored and izeye committed Jan 18, 2025
1 parent 2ba3d54 commit 752eb7a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ else if (allowIllegalReflectiveAccess) {
if (className.equals("java.util.concurrent.Executors$DelegatedScheduledExecutorService")) {
monitor(registry, unwrapThreadPoolExecutor(executorService, executorService.getClass()));
}
else if (className.equals("java.util.concurrent.Executors$FinalizableDelegatedExecutorService")) {
else if (className.equals("java.util.concurrent.Executors$FinalizableDelegatedExecutorService")
|| className.equals("java.util.concurrent.Executors$AutoShutdownDelegatedExecutorService")) {
monitor(registry,
unwrapThreadPoolExecutor(executorService, executorService.getClass().getSuperclass()));
}
Expand Down

0 comments on commit 752eb7a

Please sign in to comment.