Skip to content

Commit 6114a72

Browse files
committed
Workaround for NativeAOT recursive lock on Unix
1 parent 233553d commit 6114a72

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

core/src/main/java/org/mini2Dx/miniscript/core/threadpool/KavaThreadPoolProvider.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,16 @@ public void shutdown(boolean interruptThreads) {
9191
if (!interruptThreads) {
9292
return;
9393
}
94-
for (int i = 0; i < threads.length; i++) {
95-
threads[i].interrupt();
96-
}
94+
new Thread(() -> {
95+
for (int i = 0; i < threads.length; i++) {
96+
threads[i].interrupt();
97+
98+
//NativeAOT workaround
99+
try {
100+
Thread.sleep(100);
101+
} catch(Exception e) {}
102+
}
103+
}).start();
97104
}
98105

99106
@Override

0 commit comments

Comments
 (0)