summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-05-21 15:04:13 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-05-21 15:04:13 -0400
commit81a85ad8d702ddfaf91dc43b5a0bc78857759209 (patch)
treed0eb9731f3fefc18ce683810a6a3b96285c9cbd0 /sql/wsrep_thd.cc
parent99df0fbad5147b02ffed926f50cef11f9427e398 (diff)
downloadmariadb-git-81a85ad8d702ddfaf91dc43b5a0bc78857759209.tar.gz
bzr merge -r3985..3991 codership/5.5
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index 78ba559380b..7d61af8d84e 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -28,11 +28,19 @@
#include "rpl_rli.h"
#include "rpl_mi.h"
-static long long wsrep_bf_aborts_counter = 0;
+#if (__LP64__)
+static volatile int64 wsrep_bf_aborts_counter(0);
+#define WSREP_ATOMIC_LOAD_LONG my_atomic_load64
+#define WSREP_ATOMIC_ADD_LONG my_atomic_add64
+#else
+static volatile int32 wsrep_bf_aborts_counter(0);
+#define WSREP_ATOMIC_LOAD_LONG my_atomic_load32
+#define WSREP_ATOMIC_ADD_LONG my_atomic_add32
+#endif
int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff)
{
- wsrep_local_bf_aborts = my_atomic_load64(&wsrep_bf_aborts_counter);
+ wsrep_local_bf_aborts = WSREP_ATOMIC_LOAD_LONG(&wsrep_bf_aborts_counter);
var->type = SHOW_LONGLONG;
var->value = (char*)&wsrep_local_bf_aborts;
return 0;
@@ -44,7 +52,7 @@ void wsrep_client_rollback(THD *thd)
WSREP_DEBUG("client rollback due to BF abort for (%ld), query: %s",
thd->thread_id, thd->query());
- my_atomic_add64(&wsrep_bf_aborts_counter, 1);
+ WSREP_ATOMIC_ADD_LONG(&wsrep_bf_aborts_counter, 1);
thd->wsrep_conflict_state= ABORTING;
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);