# HG changeset patch # User one # Date 1287804886 -32400 # Node ID 5945266c970dfa4de6434ad2d719276897bc52d3 # Parent 16890938847950ccb55ce6c220d2de8c83be95dc before unMergedCmds fix , deadlockTimer API diff -r 168909388479 -r 5945266c970d Todo --- a/Todo Sat Oct 23 02:56:20 2010 +0900 +++ b/Todo Sat Oct 23 12:34:46 2010 +0900 @@ -1,3 +1,15 @@ +Sat Oct 23 12:04:43 JST 2010 + +sentList から外すときに、unMergeCmds からも外すのだが、その時に、merge command が +外れないらしい。 + + それっぽいものをunMergedCmdsから外す + unMergedCmds に sentList との対応を足す + そもそも、unMergedCmds = reverse(sentList) なはず (merge中以外) + unMergedCmds を廃止 (merge 時は、sentMergeList を使う) + +とか言う手を思い付きますが… + Thu Oct 21 12:27:44 JST 2010 外部からのINESRT に USER_INSERTがはまりこんでいるが… diff -r 168909388479 -r 5945266c970d rep/ServerMainLoop.java --- a/rep/ServerMainLoop.java Sat Oct 23 02:56:20 2010 +0900 +++ b/rep/ServerMainLoop.java Sat Oct 23 12:34:46 2010 +0900 @@ -43,6 +43,8 @@ protected static final int DEFAULT_PORT = 8766; private SessionManagerEvent execAfterConnect = null; private boolean running = true; + // dead lock detection in msec, -1 means no deadlock detection + public int deadlockTime = -1; public void setReceivePort(int port) { @@ -59,7 +61,7 @@ } public void mainLoop() throws IOException { - int deadlock = 0; + int deadlock = deadlockTime; while(running){ manager.checkWaitingCommandInMerge(); if (checkInputEvent() || @@ -70,9 +72,9 @@ //continue; } // now we can wait for input packet or event - if (deadlock++>1000) deadlockDetected(); + if (deadlock-- ==0) deadlockDetected(); selector.select(1); - if (select()) deadlock=0; + if (select()) deadlock=deadlockTime; } } @@ -277,5 +279,9 @@ public void setManager(SessionManager sessionManager) { manager = sessionManager; } + + public void setDeadlockTime(int t) { + deadlockTime = t; + } } \ No newline at end of file diff -r 168909388479 -r 5945266c970d test/sematest/TestSessionManager.java --- a/test/sematest/TestSessionManager.java Sat Oct 23 02:56:20 2010 +0900 +++ b/test/sematest/TestSessionManager.java Sat Oct 23 12:34:46 2010 +0900 @@ -86,6 +86,7 @@ Runnable start = new Runnable() { public void run() { try { + sm.setDeadlockTime(1000); sm.init(port1,gui); } catch (IOException e) { } catch (InterruptedException e) {