Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp

Issue 1463683002: Switch wtf/SpinLock to std::atomic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asan iwyu Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
diff --git a/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp b/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
index bad31582da697fe35db3a317a479e44fc7f25ae5..cc00aaaf744ac3a17f4cc3054890b578908a933a 100644
--- a/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
+++ b/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
@@ -22,7 +22,7 @@ namespace {
// This is the same PRNG as used by tcmalloc for mapping address randomness;
// see http://burtleburtle.net/bob/rand/smallprng.html
struct ranctx {
- int lock;
+ SpinLock lock;
bool initialized;
uint32_t a;
uint32_t b;
@@ -46,7 +46,7 @@ uint32_t ranvalInternal(ranctx* x)
uint32_t ranval(ranctx* x)
{
- spinLockLock(&x->lock);
+ SpinLock::Guard guard(x->lock);
if (UNLIKELY(!x->initialized)) {
x->initialized = true;
char c;
@@ -73,7 +73,6 @@ uint32_t ranval(ranctx* x)
}
}
uint32_t ret = ranvalInternal(x);
- spinLockUnlock(&x->lock);
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698