File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3587,10 +3587,6 @@ inline void PlatformInit() {
35873587 RegisterSignalHandler (SIGINT, SignalExit, true );
35883588 RegisterSignalHandler (SIGTERM, SignalExit, true );
35893589
3590- // Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the
3591- // performance penalty of frequent EINTR wakeups when the profiler is running.
3592- uv_loop_configure (uv_default_loop (), UV_LOOP_BLOCK_SIGNAL, SIGPROF);
3593-
35943590 // Raise the open file descriptor limit.
35953591 struct rlimit lim;
35963592 if (getrlimit (RLIMIT_NOFILE, &lim) == 0 && lim.rlim_cur != lim.rlim_max ) {
@@ -3674,6 +3670,15 @@ void Init(int* argc,
36743670 }
36753671 }
36763672
3673+ #ifdef __POSIX__
3674+ // Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the
3675+ // performance penalty of frequent EINTR wakeups when the profiler is running.
3676+ // Only do this for v8.log profiling, as it breaks v8::CpuProfiler users.
3677+ if (v8_is_profiling) {
3678+ uv_loop_configure (uv_default_loop (), UV_LOOP_BLOCK_SIGNAL, SIGPROF);
3679+ }
3680+ #endif
3681+
36773682#if defined(NODE_HAVE_I18N_SUPPORT)
36783683 if (icu_data_dir == nullptr ) {
36793684 // if the parameter isn't given, use the env variable.
You can’t perform that action at this time.
0 commit comments