You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "yangkun (JIRA)" <ji...@apache.org> on 2018/08/29 13:35:00 UTC
[jira] [Created] (ZOOKEEPER-3134) NIOServerCnxnFactory#run() method
should remove synchronized (this)
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)