Fix undefined behavior.
BUG=skia:4050 Review URL: https://codereview.chromium.org/1232003008
This commit is contained in:
parent
dc77b35918
commit
fd9a6a227b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user