summaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-07 00:23:32 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-07 00:23:32 +0100
commit16b9b998dd0aad126273b33d20a930c98ccb5b66 (patch)
treeaf919dffc1bfe55e7996d41375afcec84f36f67d /vespamalloc
parent71e8f738f84be80b5d0db6c927d71d2d5810ab15 (diff)
Use fetch_add/fetch_sub instead of ++/--
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/vespamalloc/malloc/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vespamalloc/src/vespamalloc/malloc/common.h b/vespamalloc/src/vespamalloc/malloc/common.h
index 428eb3c7a83..96dd1869a43 100644
--- a/vespamalloc/src/vespamalloc/malloc/common.h
+++ b/vespamalloc/src/vespamalloc/malloc/common.h
@@ -86,8 +86,8 @@ public:
~Mutex() { quit(); }
void lock();
void unlock();
- static void addThread() { _threadCount++; }
- static void subThread() { _threadCount--; }
+ static void addThread() { _threadCount.fetch_add(1); }
+ static void subThread() { _threadCount.fetch_sub(1); }
static void stopRecursion() { _stopRecursion = true; }
static void allowRecursion() { _stopRecursion = false; }
void init();