From dd46c43c737ca975cc828bd9b44b3eb47f8517c8 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Wed, 30 Apr 2025 23:25:16 +1000 Subject: [PATCH] Attempt to fix stupid concurrency issue by force stealing jobs --- .../java/me/cortex/voxy/common/thread/ServiceThreadPool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java index de847eeb..e8d198e3 100644 --- a/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java +++ b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java @@ -129,7 +129,9 @@ public class ServiceThreadPool { void steal(ServiceSlice service, int count) { this.totalJobWeight.addAndGet(-(service.weightPerJob*(long)count)); - this.jobCounter.acquireUninterruptibly(count); + for (int i = 0; i < count; i++) { + this.jobCounter.acquireUninterruptibly(); + } } private void worker(int threadId) {