File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828# ifndef cpu_relax
2929#if defined(ARCH_CPU_ARM_FAMILY )
3030# define cpu_relax () asm volatile("yield\n": : :"memory")
31+ #elif defined(ARCH_CPU_RISCV_FAMILY )
32+ # define cpu_relax () asm volatile("fence.i\n": : :"memory")
3133#elif defined(ARCH_CPU_LOONGARCH64_FAMILY )
3234# define cpu_relax () asm volatile("nop\n": : :"memory");
3335#else
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ AtomicInteger128::Value AtomicInteger128::load() const {
101101 return {value[0 ], value[1 ]};
102102#else // __x86_64__ || __ARM_NEON
103103 // RISC-V and other architectures use mutex fallback
104- BAIDU_SCOPED_LOCK (_mutex);
104+ BAIDU_SCOPED_LOCK (const_cast <FastPthreadMutex&>( _mutex) );
105105 return _value;
106106#endif // __x86_64__ || __ARM_NEON
107107}
@@ -115,7 +115,7 @@ void AtomicInteger128::store(Value value) {
115115 vst1q_s64 (reinterpret_cast <int64_t *>(&_value), v);
116116#else
117117 // RISC-V and other architectures use mutex fallback
118- BAIDU_SCOPED_LOCK (_mutex);
118+ BAIDU_SCOPED_LOCK (const_cast <FastPthreadMutex&>( _mutex) );
119119 _value = value;
120120#endif // __x86_64__ || __ARM_NEON
121121}
You can’t perform that action at this time.
0 commit comments