jamesge commented on a change in pull request #924: adapt to Arm64
URL: https://github.com/apache/incubator-brpc/pull/924#discussion_r326962632
 
 

 ##########
 File path: src/bthread/processor.h
 ##########
 @@ -23,9 +23,15 @@
 #ifndef BTHREAD_PROCESSOR_H
 #define BTHREAD_PROCESSOR_H
 
+#include "butil/build_config.h"
+
 // Pause instruction to prevent excess processor bus usage, only works in GCC
 # ifndef cpu_relax
+#if defined(ARCH_CPU_X86_FAMILY)
 # define cpu_relax() asm volatile("pause\n": : :"memory")
+#elif defined(ARCH_CPU_ARM_FAMILY)
+# define cpu_relax() asm volatile("yield\n": : :"memory")
+#endif
 
 Review comment:
   需要补充else分支,要么让上述一个分支成为默认行为,要么在其中打印#error

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to