[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}
This commit is contained in:
parent
f47f88ad0e
commit
cf420ec337
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user