--- zookeeper-3.2.2+dfsg3.orig/src/c/src/mt_adaptor.c
+++ zookeeper-3.2.2+dfsg3/src/c/src/mt_adaptor.c
@@ -349,11 +349,7 @@
 int32_t fetch_and_add(volatile int32_t* operand, int incr)
 {
     int32_t result;
-    asm __volatile__(
-         "lock xaddl %0,%1\n"
-         : "=r"(result), "=m"(*(int *)operand)
-         : "0"(incr)
-         : "memory");
+    result = __sync_fetch_and_add(operand, incr);
    return result;
 }
 
