File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -504,10 +504,9 @@ int VersionedRefWithId<T>::ReleaseAdditionalReference() {
504504 do {
505505 AdditionalRefStatus expect = ADDITIONAL_REF_USING;
506506 if (_additional_ref_status.compare_exchange_strong (
507- expect, ADDITIONAL_REF_RECYCLED,
508- butil::memory_order_relaxed,
509- butil::memory_order_relaxed)) {
510- BeforeAdditionalRefReleasedWrapper ();
507+ expect, ADDITIONAL_REF_RECYCLED,
508+ butil::memory_order_relaxed,
509+ butil::memory_order_relaxed)) {
511510 WRAPPER_CALL (BeforeAdditionalRefReleased, static_cast <T*>(this ));
512511 return Dereference ();
513512 }
@@ -591,7 +590,7 @@ void VersionedRefWithId<T>::Revive(int32_t at_least_nref) {
591590
592591 int32_t nref = NRefOfVRef (vref);
593592 if (nref < at_least_nref) {
594- // Set the status to REF_RECYLED since no one uses this socket
593+ // Set the status to REF_RECYCLED since no one uses this socket
595594 _additional_ref_status.store (
596595 ADDITIONAL_REF_RECYCLED, butil::memory_order_relaxed);
597596 CHECK_EQ (1 , nref);
Original file line number Diff line number Diff line change 2121#include " butil/macros.h"
2222#include " butil/scoped_lock.h"
2323#include " bthread/work_stealing_queue.h"
24+ #include " bthread/processor.h"
2425
2526namespace {
2627typedef size_t value_type;
@@ -39,13 +40,7 @@ void* steal_thread(void* arg) {
3940 if (q->steal (&val)) {
4041 stolen->push_back (val);
4142 } else {
42- #if defined(ARCH_CPU_ARM_FAMILY)
43- asm volatile (" yield\n " : : :" memory" );
44- #elif defined(ARCH_CPU_LOONGARCH64_FAMILY)
45- asm volatile (" nop\n " : : :" memory" );
46- #else
47- asm volatile (" pause\n " : : :" memory" );
48- #endif
43+ cpu_relax ();
4944 }
5045 }
5146 return stolen;
You can’t perform that action at this time.
0 commit comments