未验证 提交 bf3cc0d0 编写于 作者: T tswstarplanet 提交者: GitHub

[Bug][Refactor][issue-3157]use cas to avoid thread safe problem (#3158)

Co-authored-by: Nlgcareer <18610854716@163.com>
上级 d4d6aded
......@@ -119,11 +119,7 @@ public class NettyRemotingServer {
* server start
*/
public void start(){
if(this.isStarted.get()){
return;
}
if (isStarted.compareAndSet(false, true)) {
this.serverBootstrap
.group(this.bossGroup, this.workGroup)
.channel(NioServerSocketChannel.class)
......@@ -155,8 +151,7 @@ public class NettyRemotingServer {
} else {
throw new RuntimeException(String.format("NettyRemotingServer bind %s fail", serverConfig.getListenPort()));
}
//
isStarted.compareAndSet(false, true);
}
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册