yangkun created ZOOKEEPER-3134:
----------------------------------

             Summary: NIOServerCnxnFactory#run() method should remove 
synchronized (this)
                 Key: ZOOKEEPER-3134
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3134
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: yangkun


Now NIOServerCnxnFactory#run() method is:

 
{code:java}
while (!ss.socket().isClosed()) {
    try {
        selector.select(1000);
        Set<SelectionKey> selected;
        // should remove synchronized?
        synchronized (this) {
           selected = selector.selectedKeys();
        }
       ArrayList<SelectionKey> selectedList = new 
ArrayList<SelectionKey>(selected);
       ...
    }
}
{code}
It seems like no need to use synchronized (this)  statement, here is thread 
safe, should remove this statement?

Or is any of this statement  making sense?

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to