aboutsummaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-08-11 15:40:59 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-08-11 15:40:59 +0200
commit4a21c10c51e23222376867b5a022d3592a4e79a0 (patch)
tree17fd6756c8c3f68bdaea80c42c8ac59770e53bc1 /vespamalloc
parentc521ef714c7054c5a5c0d2e6b72f0cd6d34ec2e5 (diff)
Use explicit fetch_xxx instead of --/++ to signal costly operations.
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/tests/thread/thread.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp
index 3a4fa366c38..b121f1e513b 100644
--- a/vespamalloc/src/tests/thread/thread.cpp
+++ b/vespamalloc/src/tests/thread/thread.cpp
@@ -54,11 +54,11 @@ void * just_wait(void * arg)
{
wait_info * info = (wait_info *) arg;
pthread_mutex_lock(&info->_mutex);
- info->_count++;
+ info->_count.fetch_add(1);
pthread_cond_wait(&info->_cond, &info->_mutex);
pthread_mutex_unlock(&info->_mutex);
pthread_cond_signal(&info->_cond);
- info->_count--;
+ info->_count.fetch_sub(1);
return arg;
}