diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-11 15:40:59 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-11 15:40:59 +0200 |
commit | 4a21c10c51e23222376867b5a022d3592a4e79a0 (patch) | |
tree | 17fd6756c8c3f68bdaea80c42c8ac59770e53bc1 /vespamalloc | |
parent | c521ef714c7054c5a5c0d2e6b72f0cd6d34ec2e5 (diff) |
Use explicit fetch_xxx instead of --/++ to signal costly operations.
Diffstat (limited to 'vespamalloc')
-rw-r--r-- | vespamalloc/src/tests/thread/thread.cpp | 4 |
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; } |