BurningCN commented on code in PR #9954:
URL: https://github.com/apache/dubbo/pull/9954#discussion_r856009803
##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/Connection.java:
##########
@@ -192,10 +192,8 @@ public boolean isAvailable() {
if (channel != null && channel.isActive()) {
return true;
}
- synchronized (this) {
Review Comment:
Under multi-threading, the function of `sync` here is to let those threads
that have not acquired locks wait. When these waiting threads are released from
waiting, it can be ensured that the `bootstrap.connect()` operation must have
been initiated (this operation is acquired locked thread).
I think the `init` property here can be replaced with a `volatile boolean
`type
#9381
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]