Skip to content

Commit

Permalink
Replace with thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
warunalakshitha committed Dec 11, 2024
1 parent 32b965a commit 17f2562
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.management.MBeanServer;

Expand All @@ -48,7 +51,8 @@ private Utils() {
}

static {
Thread.startVirtualThread(() -> {
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.submit(() -> {
try {
int count = 0;
while (true) {
Expand Down

0 comments on commit 17f2562

Please sign in to comment.