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

Unified Diff: third_party/WebKit/Source/web/tests/SpinLockTest.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/web/tests/SpinLockTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/SpinLockTest.cpp b/third_party/WebKit/Source/web/tests/SpinLockTest.cpp
index 18abef96e2ecfe6f7b0adb4d3fa976f61400979f..7806b5bb710660837a4542b76f17e509474a9d6f 100644
--- a/third_party/WebKit/Source/web/tests/SpinLockTest.cpp
+++ b/third_party/WebKit/Source/web/tests/SpinLockTest.cpp
@@ -44,7 +44,7 @@ namespace blink {
static const size_t bufferSize = 16;
-static int lock = 0;
+static SpinLock lock;
static void fillBuffer(volatile char* buffer, char fillPattern)
{
@@ -69,9 +69,8 @@ static void changeAndCheckBuffer(volatile char* buffer)
static void threadMain(volatile char* buffer)
{
for (int i = 0; i < 500000; ++i) {
- spinLockLock(&lock);
+ SpinLock::Guard guard(lock);
changeAndCheckBuffer(buffer);
- spinLockUnlock(&lock);
}
}

Powered by Google App Engine
This is Rietveld 408576698