aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSharedMutex.cpp
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2015-07-15 07:40:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-15 07:40:37 -0700
commitfd9a6a227b269f23fb5b353318f1d3a667617329 (patch)
tree0c3df5d30269fe3ebc152152819cc49639e9f62a /src/core/SkSharedMutex.cpp
parentdc77b3591841bf1e70ed45455490d688e5d4e6f9 (diff)
Fix undefined behavior.
Diffstat (limited to 'src/core/SkSharedMutex.cpp')
-rw-r--r--src/core/SkSharedMutex.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/SkSharedMutex.cpp b/src/core/SkSharedMutex.cpp
index 3815ec3f28..b9af10a2be 100644
--- a/src/core/SkSharedMutex.cpp
+++ b/src/core/SkSharedMutex.cpp
@@ -11,7 +11,6 @@
#include "SkSemaphore.h"
#include "SkTypes.h"
-
#if defined(THREAD_SANITIZER)
/* Report that a lock has been created at address "lock". */
@@ -168,7 +167,7 @@ void SkSharedMutex::releaseShared() {
ANNOTATE_RWLOCK_RELEASED(this, 0);
// Decrement the shared count.
- int32_t oldQueueCounts = fQueueCounts.fetch_add(-1 << kSharedOffset,
+ int32_t oldQueueCounts = fQueueCounts.fetch_add(~0U << kSharedOffset,
sk_memory_order_release);
// If shared count is going to zero (because the old count == 1) and there are exclusive