Server: parallel op sending

This commit is contained in:
2025-03-31 16:32:13 +02:00
parent 8351bec59a
commit 06335b4b99
3 changed files with 12 additions and 9 deletions

View File

@@ -19,16 +19,17 @@ public class DataLocker {
var tag = _locks.get(data);
if (tag != null) {
synchronized (tag) {
if (!tag.released) {
while (!tag.released) {
if (tag.owner == Thread.currentThread()) {
return DUMMY_LOCK;
}
tag.wait(4000L);
if (!tag.released) {
System.out.println("Timeout waiting for lock: " + data);
System.exit(1);
throw new InterruptedException();
}
tag.wait();
// tag.wait(4000L);
// if (!tag.released) {
// System.out.println("Timeout waiting for lock: " + data);
// System.exit(1);
// throw new InterruptedException();
// }
}
continue;
}