Réglage blocage des threads des SBE : Les SBE attendaient d'être réveillé doublement pour reprendre le travaille

This commit is contained in:
Benjamin 2022-03-08 20:48:34 +01:00
parent d680a85bf2
commit dfde37e482
2 changed files with 2 additions and 1 deletions

View File

@ -114,6 +114,7 @@ public class StoreProcessor extends Thread implements AutoCloseable {
public void executeCommand(ProtocolWriter.ProtocolResult protocolResult) { public void executeCommand(ProtocolWriter.ProtocolResult protocolResult) {
synchronized (this) { synchronized (this) {
this.protocolResult = protocolResult; this.protocolResult = protocolResult;
System.out.println("Request wake up");
this.notify(); this.notify();
} }
} }
@ -125,7 +126,6 @@ public class StoreProcessor extends Thread implements AutoCloseable {
synchronized (this) { synchronized (this) {
this.protocolResult = null; this.protocolResult = null;
fileFrontEnd.onStoreAvailable(this, responseCommand); fileFrontEnd.onStoreAvailable(this, responseCommand);
waitAction();
} }
} }

View File

@ -74,6 +74,7 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR {
@Override @Override
public void assignTask(String stor, Task task) { public void assignTask(String stor, Task task) {
StoreProcessor handler = findSBE(task); StoreProcessor handler = findSBE(task);
System.out.println("Find stor : " + handler);
handler.executeCommand(task.getCommand()); handler.executeCommand(task.getCommand());
} }