Mercurial > hg > RemoteEditor > REPSessionManager
changeset 309:f27c8551e877
*** empty log message ***
author | kono |
---|---|
date | Sat, 04 Oct 2008 22:22:07 +0900 |
parents | c5be84d53c7f |
children | 511376c066db |
files | rep/channel/ChannelSimulator.java |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/channel/ChannelSimulator.java Sat Oct 04 22:12:34 2008 +0900 +++ b/rep/channel/ChannelSimulator.java Sat Oct 04 22:22:07 2008 +0900 @@ -39,14 +39,14 @@ } catch (InterruptedException e) { } } - // for write wait - otherEnd.wakeup(); selector.wakeup(); + // for write wait (we don't need this) + //otherEnd.wakeup(); selector.wakeup(); return tmp; } - private synchronized void wakeup() { - notify(); - } + //private synchronized void wakeup() { + // notify(); + //} /** write packet to other end. */ public boolean write(P p){ @@ -61,7 +61,8 @@ notify(); // other end my wait() selector.wakeup(); // selector may wait break; - } else { + } else { // this can't happen + assert(false); try { wait(); // queue is full, we have to wait here } catch (InterruptedException e) { @@ -92,14 +93,14 @@ public boolean isAcceptable() { return false; } - public boolean isReadable() { - synchronized (selector){ - return !readQ.isEmpty(); - } + public synchronized boolean isReadable() { + return !readQ.isEmpty(); } + public boolean isWritable() { return true; } + @Override public SelectableChannel configureBlocking(boolean block) throws IOException { isBlocking = block;