提交 e9f9ff68 编写于 作者: L liquidsnake@sapo.pt

In this commit, i fixed a bug that would make the delayed replica get in an...

In this commit, i fixed a bug that would make the delayed replica get in an invalid state, which would manifestitself  in the counter as more increments than the ones issued by the clients
上级 e9d557c0
......@@ -152,7 +152,16 @@ public abstract class ServiceReplica extends TOMReceiver implements Runnable {
protected abstract byte[] serializeState();
public void setState(byte[] state) {
stateLock.lock();
while (!requestQueue.isEmpty()) {
try {
stateCondition.await();
} catch (InterruptedException ex) {
Logger.getLogger(ServiceReplica.class.getName()).log(Level.SEVERE, null, ex);
}
}
deserializeState(state);
stateLock.unlock();
}
protected abstract void deserializeState(byte[] state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册