chenBright commented on code in PR #1817:
URL: https://github.com/apache/incubator-brpc/pull/1817#discussion_r928380436
##########
src/brpc/socket.h:
##########
@@ -797,9 +805,17 @@ friend void DereferenceSocket(Socket*);
// Set by SetLogOff
butil::atomic<bool> _logoff_flag;
- // Flag used to mark whether additional reference has been decreased
- // by either `SetFailed' or `SetRecycle'
- butil::atomic<bool> _recycle_flag;
+ enum AdditionalRefStatus {
+ REF_USING, // socket is normal
+ REF_REVIVING, // socket is reviving
+ REF_RECYCLED // socket has been recycled
Review Comment:
done
##########
src/brpc/socket.h:
##########
@@ -797,9 +805,17 @@ friend void DereferenceSocket(Socket*);
// Set by SetLogOff
butil::atomic<bool> _logoff_flag;
- // Flag used to mark whether additional reference has been decreased
- // by either `SetFailed' or `SetRecycle'
- butil::atomic<bool> _recycle_flag;
+ enum AdditionalRefStatus {
+ REF_USING, // socket is normal
+ REF_REVIVING, // socket is reviving
+ REF_RECYCLED // socket has been recycled
+ };
+
+ // additional ref status:
+ // Socket()、Create(): REF_USING
+ // SetFailed(): REF_USING -> REF_RECYCLED
+ // Revive(): REF_RECYCLED -> REF_REVIVING -> REF_USING
Review Comment:
done
--
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]