--- zookeeper-3.4.6/src/c/src/mt_adaptor.c.ORG 2015-10-05 20:50:36.662228733 +0000 | |
+++ zookeeper-3.4.6/src/c/src/mt_adaptor.c 2015-10-05 20:51:35.722773398 +0000 | |
@@ -483,13 +483,7 @@ | |
int32_t fetch_and_add(volatile int32_t* operand, int incr) | |
{ | |
#ifndef WIN32 | |
- int32_t result; | |
- asm __volatile__( | |
- "lock xaddl %0,%1\n" | |
- : "=r"(result), "=m"(*(int *)operand) | |
- : "0"(incr) | |
- : "memory"); | |
- return result; | |
+ return __sync_fetch_and_add(operand, incr); | |
#else | |
volatile int32_t result; | |
_asm |