Skip to content

Commit

Permalink
Add zookeeper patch for 3.4.8 to support PPC LE platform.
Browse files Browse the repository at this point in the history
Carried this patch from upstream zookeeper, since the
fetch_and_add function in zookeeper is not 64bit-compatible.
Details see: https://issues.apache.org/jira/browse/ZOOKEEPER-1643

Review: https://reviews.apache.org/r/45376/
  • Loading branch information
chenzhiwei authored and vinodkone committed Apr 4, 2016
1 parent b9ffcd7 commit 5ff13be
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 3rdparty/zookeeper-3.4.8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/src/c/src/mt_adaptor.c b/src/c/src/mt_adaptor.c
index 7dc7878..9c62991 100644
--- a/src/c/src/mt_adaptor.c
+++ b/src/c/src/mt_adaptor.c
@@ -483,13 +483,7 @@ int32_t inc_ref_counter(zhandle_t* zh,int i)
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

0 comments on commit 5ff13be

Please sign in to comment.