chenBright commented on code in PR #1817:
URL: https://github.com/apache/incubator-brpc/pull/1817#discussion_r904503401
##########
src/brpc/socket.cpp:
##########
@@ -770,12 +773,16 @@ void Socket::Revive() {
}
int Socket::ReleaseAdditionalReference() {
- bool expect = false;
- // Use `relaxed' fence here since `Dereference' has `released' fence
- if (_recycle_flag.compare_exchange_strong(
- expect, true,
- butil::memory_order_relaxed,
- butil::memory_order_relaxed)) {
+ // wait until status is not REF_REVIVING
+ while (_additional_ref_status.load(butil::memory_order_relaxed) ==
REF_REVIVING) {
Review Comment:
已修改
##########
src/brpc/socket.cpp:
##########
@@ -770,12 +773,16 @@ void Socket::Revive() {
}
int Socket::ReleaseAdditionalReference() {
- bool expect = false;
- // Use `relaxed' fence here since `Dereference' has `released' fence
- if (_recycle_flag.compare_exchange_strong(
- expect, true,
- butil::memory_order_relaxed,
- butil::memory_order_relaxed)) {
+ // wait until status is not REF_REVIVING
+ while (_additional_ref_status.load(butil::memory_order_relaxed) ==
REF_REVIVING) {
+ bthread_yield();
Review Comment:
已修改
--
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]