[base] Drop obsolete Thread::YieldCPU.
authorbmeurer <bmeurer@chromium.org>
Thu, 30 Apr 2015 08:08:46 +0000 (01:08 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 30 Apr 2015 08:08:54 +0000 (08:08 +0000)
The method is not used anywhere, and it is a bad idea in general anyway.
If you see a need to call YieldCPU, then you're code is probably in need
of a redesign!

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/1116853002

Cr-Commit-Position: refs/heads/master@{#28147}

src/base/platform/platform-posix.cc
src/base/platform/platform-win32.cc
src/base/platform/platform.h
test/cctest/test-threads.cc

index 8fb40b0..78b8d78 100644 (file)
@@ -631,13 +631,6 @@ void Thread::Join() {
 }
 
 
-void Thread::YieldCPU() {
-  int result = sched_yield();
-  DCHECK_EQ(0, result);
-  USE(result);
-}
-
-
 static Thread::LocalStorageKey PthreadKeyToLocalKey(pthread_key_t pthread_key) {
 #if V8_OS_CYGWIN
   // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps
@@ -761,5 +754,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
   USE(result);
 }
 
-
-} }  // namespace v8::base
+}  // namespace base
+}  // namespace v8
index b0677af..397b7a9 100644 (file)
@@ -1384,10 +1384,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
   DCHECK(result);
 }
 
-
-
-void Thread::YieldCPU() {
-  Sleep(0);
-}
-
-} }  // namespace v8::base
+}  // namespace base
+}  // namespace v8
index 2d837ba..f54eef3 100644 (file)
@@ -446,10 +446,6 @@ class Thread {
   }
 #endif
 
-  // A hint to the scheduler to let another thread run.
-  static void YieldCPU();
-
-
   // The thread name length is limited to 16 based on Linux's implementation of
   // prctl().
   static const int kMaxThreadNameLength = 16;
index 0f332a3..e192bc1 100644 (file)
@@ -70,7 +70,6 @@ class ThreadA : public v8::base::Thread {
     do {
       {
         v8::Unlocker unlocker(CcTest::isolate());
-        Thread::YieldCPU();
       }
     } while (turn != SECOND_TIME_FILL_CACHE);
 
@@ -102,8 +101,6 @@ class ThreadB : public v8::base::Thread {
           break;
         }
       }
-
-      Thread::YieldCPU();
     } while (true);
   }
 };