Commit cf420ec3 authored by bmeurer's avatar bmeurer Committed by Commit bot

[base] Drop obsolete Thread::YieldCPU.

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}
parent f47f88ad
...@@ -631,13 +631,6 @@ void Thread::Join() { ...@@ -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) { static Thread::LocalStorageKey PthreadKeyToLocalKey(pthread_key_t pthread_key) {
#if V8_OS_CYGWIN #if V8_OS_CYGWIN
// We need to cast pthread_key_t to Thread::LocalStorageKey in two steps // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps
...@@ -761,5 +754,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) { ...@@ -761,5 +754,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
USE(result); USE(result);
} }
} // namespace base
} } // namespace v8::base } // namespace v8
...@@ -1384,10 +1384,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) { ...@@ -1384,10 +1384,5 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
DCHECK(result); DCHECK(result);
} }
} // namespace base
} // namespace v8
void Thread::YieldCPU() {
Sleep(0);
}
} } // namespace v8::base
...@@ -446,10 +446,6 @@ class Thread { ...@@ -446,10 +446,6 @@ class Thread {
} }
#endif #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 // The thread name length is limited to 16 based on Linux's implementation of
// prctl(). // prctl().
static const int kMaxThreadNameLength = 16; static const int kMaxThreadNameLength = 16;
......
...@@ -70,7 +70,6 @@ class ThreadA : public v8::base::Thread { ...@@ -70,7 +70,6 @@ class ThreadA : public v8::base::Thread {
do { do {
{ {
v8::Unlocker unlocker(CcTest::isolate()); v8::Unlocker unlocker(CcTest::isolate());
Thread::YieldCPU();
} }
} while (turn != SECOND_TIME_FILL_CACHE); } while (turn != SECOND_TIME_FILL_CACHE);
...@@ -102,8 +101,6 @@ class ThreadB : public v8::base::Thread { ...@@ -102,8 +101,6 @@ class ThreadB : public v8::base::Thread {
break; break;
} }
} }
Thread::YieldCPU();
} while (true); } while (true);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment