Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

v8: don't busy loop in cpu profiler thread #8789

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions deps/v8/src/platform-freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}


void Thread::YieldCPU() {
sched_yield();
}


class FreeBSDMutex : public Mutex {
public:
FreeBSDMutex() {
Expand Down
5 changes: 0 additions & 5 deletions deps/v8/src/platform-linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}


void Thread::YieldCPU() {
sched_yield();
}


class LinuxMutex : public Mutex {
public:
LinuxMutex() {
Expand Down
5 changes: 0 additions & 5 deletions deps/v8/src/platform-macos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}


void Thread::YieldCPU() {
sched_yield();
}


class MacOSMutex : public Mutex {
public:
MacOSMutex() {
Expand Down
5 changes: 0 additions & 5 deletions deps/v8/src/platform-openbsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}


void Thread::YieldCPU() {
sched_yield();
}


class OpenBSDMutex : public Mutex {
public:
OpenBSDMutex() {
Expand Down
6 changes: 6 additions & 0 deletions deps/v8/src/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
}


void Thread::YieldCPU() {
const timespec delay = { 0, 1 };
nanosleep(&delay, NULL);
}


// ----------------------------------------------------------------------------
// POSIX socket support.
//
Expand Down
5 changes: 0 additions & 5 deletions deps/v8/src/platform-solaris.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}


void Thread::YieldCPU() {
sched_yield();
}


class SolarisMutex : public Mutex {
public:
SolarisMutex() {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/tools/gyp/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
['OS=="solaris"', {
'link_settings': {
'libraries': [
'-lsocket -lnsl',
'-lsocket -lnsl -lrt',
]},
'sources': [
'../../src/platform-solaris.cc',
Expand Down