提交 5c3412d2 编写于 作者: R Rich Felker

fix regression disabling use of pause instruction for x86 a_spin

commits e24984ef and
16b55298 inadvertently disabled the
a_spin implementations for i386, x86_64, and x32 by defining a macro
named a_pause instead of a_spin. this should not have caused any
functional regression, but it inhibited cpu relaxation while spinning
for locks.

bug reported by George Kulakowski.
上级 6d1a3dfe
...@@ -71,7 +71,7 @@ static inline void a_barrier() ...@@ -71,7 +71,7 @@ static inline void a_barrier()
__asm__ __volatile__( "" : : : "memory" ); __asm__ __volatile__( "" : : : "memory" );
} }
#define a_pause a_pause #define a_spin a_spin
static inline void a_spin() static inline void a_spin()
{ {
__asm__ __volatile__( "pause" : : : "memory" ); __asm__ __volatile__( "pause" : : : "memory" );
......
...@@ -87,7 +87,7 @@ static inline void a_barrier() ...@@ -87,7 +87,7 @@ static inline void a_barrier()
__asm__ __volatile__( "" : : : "memory" ); __asm__ __volatile__( "" : : : "memory" );
} }
#define a_pause a_pause #define a_spin a_spin
static inline void a_spin() static inline void a_spin()
{ {
__asm__ __volatile__( "pause" : : : "memory" ); __asm__ __volatile__( "pause" : : : "memory" );
......
...@@ -96,7 +96,7 @@ static inline void a_barrier() ...@@ -96,7 +96,7 @@ static inline void a_barrier()
__asm__ __volatile__( "" : : : "memory" ); __asm__ __volatile__( "" : : : "memory" );
} }
#define a_pause a_pause #define a_spin a_spin
static inline void a_spin() static inline void a_spin()
{ {
__asm__ __volatile__( "pause" : : : "memory" ); __asm__ __volatile__( "pause" : : : "memory" );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册