Mercurial > hg > RemoteEditor > REPSessionManager
changeset 436:5e3532db2e07
fix enQ
author | one |
---|---|
date | Wed, 01 Sep 2010 11:43:21 +0900 |
parents | 2b034d12170e |
children | 2c00fa39dd84 |
files | Todo rep/channel/NetworkSimulator.java rep/channel/ServerChannelSimulator.java rep/handler/Editor.java |
diffstat | 4 files changed, 17 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/Todo Sat Jan 16 18:02:26 2010 +0900 +++ b/Todo Wed Sep 01 11:43:21 2010 +0900 @@ -1,3 +1,8 @@ +Sat Jan 16 18:06:37 JST 2010 + +sentList 全部削除だと quit2 が早めに出されてしまうので、 +ちゃんと終了しない。 + Tue Jan 12 01:20:12 JST 2010 sentList の先頭を削除するのは、Merge が終った後。一周した部分は、
--- a/rep/channel/NetworkSimulator.java Sat Jan 16 18:02:26 2010 +0900 +++ b/rep/channel/NetworkSimulator.java Wed Sep 01 11:43:21 2010 +0900 @@ -56,7 +56,6 @@ sd0.connectedListS.add(CHserver); sd0.connectedListC.add(CHclient); sd0.scs.enQ(CHserver); - logger.writeLog("connected", 1); //printAllState(); return true;
--- a/rep/channel/ServerChannelSimulator.java Sat Jan 16 18:02:26 2010 +0900 +++ b/rep/channel/ServerChannelSimulator.java Wed Sep 01 11:43:21 2010 +0900 @@ -45,23 +45,25 @@ return channel; } - protected boolean enQ(ChannelSimulator<P> ch){ + protected boolean enQ(ChannelSimulator<?> ch){ // Don't lock a selector from a locked channel, the selector may // use channel.isAble() which locks the channel. + @SuppressWarnings("unchecked") + ChannelSimulator<P>ch1 = (ChannelSimulator<P>)ch; synchronized(this) { - acceptQ.offer(ch); + acceptQ.offer(ch1); notify(); } selector.wakeup(); return true; } - - @SuppressWarnings("unchecked") - public void enQ(ChannelSimulator<?> hserver) { - // NetworkSimulator doesn't know P - ChannelSimulator<P>ch = (ChannelSimulator<P>) hserver; - enQ(ch); - } +// +// @SuppressWarnings("unchecked") +// public void enQ(ChannelSimulator<?> hserver) { +// // NetworkSimulator doesn't know P +// ChannelSimulator<P>ch = (ChannelSimulator<P>) hserver; +// enQ(ch); +// } public ServerSocket socket() { try {
--- a/rep/handler/Editor.java Sat Jan 16 18:02:26 2010 +0900 +++ b/rep/handler/Editor.java Wed Sep 01 11:43:21 2010 +0900 @@ -86,7 +86,6 @@ if (command.eid==eid) { // Second Phase が終わって同期が終了。 checkAck(command); - // sentList.remove(0); SessionManager.logger.writeLog("Complete "+command); checkQuit(); return; @@ -307,8 +306,7 @@ private void endMerge() { REPCommand mergeEnd = new REPCommand(REP.SMCMD_END_MERGE,sid,eid,seq(),0,""); send(mergeEnd); - // sentList.remove(0); - sentList.clear(); + sentList.remove(0); if (preMergeCommand.eid==eid) { // First Phase End, send ACK REPCommand keep = new REPCommand(preMergeCommand);