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

 ##########
 File path: src/bthread/processor.h
 ##########
 @@ -23,9 +23,17 @@
 #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")
+#else
 # define cpu_relax() asm volatile("pause\n": : :"memory")
+#endif
 
 Review comment:
   @niukuo 现在先合并好了,以后需要时自然可以再改动。

----------------------------------------------------------------
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