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

Unified Diff: test/cctest/test-platform-linux.cc

Issue 23548007: Import ConditionVariable class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename OperandSize enum names. Created 7 years, 3 months 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
« no previous file with comments | « test/cctest/test-condition-variable.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-platform-linux.cc
diff --git a/test/cctest/test-platform-linux.cc b/test/cctest/test-platform-linux.cc
index 7347aaceb464caf3001ff787993d14849587b2de..34ae43c2081931d9740733f8e58a8cd11c13dba5 100644
--- a/test/cctest/test-platform-linux.cc
+++ b/test/cctest/test-platform-linux.cc
@@ -39,55 +39,6 @@
using namespace ::v8::internal;
-static void yield() {
- usleep(1);
-}
-
-static const int kLockCounterLimit = 50;
-static int busy_lock_counter = 0;
-
-
-static void LoopIncrement(Mutex* mutex, int rem) {
- while (true) {
- int count = 0;
- int last_count = -1;
- do {
- LockGuard<Mutex> lock_guard(mutex);
- count = busy_lock_counter;
- yield();
- } while (count % 2 == rem && count < kLockCounterLimit);
- if (count >= kLockCounterLimit) break;
- LockGuard<Mutex> lock_guard(mutex);
- CHECK_EQ(count, busy_lock_counter);
- CHECK(last_count == -1 || count == last_count + 1);
- busy_lock_counter++;
- last_count = count;
- yield();
- }
-}
-
-
-static void* RunTestBusyLock(void* arg) {
- LoopIncrement(static_cast<Mutex*>(arg), 0);
- return 0;
-}
-
-
-// Runs two threads that repeatedly acquire the lock and conditionally
-// increment a variable.
-TEST(BusyLock) {
- pthread_t other;
- Mutex mutex;
- int thread_created = pthread_create(&other,
- NULL,
- &RunTestBusyLock,
- &mutex);
- CHECK_EQ(0, thread_created);
- LoopIncrement(&mutex, 1);
- pthread_join(other, NULL);
-}
-
-
TEST(VirtualMemory) {
OS::SetUp();
VirtualMemory* vm = new VirtualMemory(1 * MB);
« no previous file with comments | « test/cctest/test-condition-variable.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698