diff --git a/src/threadpool.c b/src/threadpool.c index 2a129a5d4a5..b101db0c42d 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -261,14 +261,6 @@ static void reset_once(void) { static void init_once(void) { -#ifndef _WIN32 - /* Re-initialize the threadpool after fork. - * Note that this discards the global mutex and condition as well - * as the work queue. - */ - if (pthread_atfork(NULL, NULL, &reset_once)) - abort(); -#endif init_threads(); } diff --git a/src/unix/linux.c b/src/unix/linux.c index 110964884dd..a89610818bb 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -56,6 +56,12 @@ #include #include +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#include +#endif +#endif + #ifndef __NR_io_uring_setup # define __NR_io_uring_setup 425 #endif @@ -1347,6 +1353,11 @@ static void uv__epoll_ctl_flush(int epollfd, void uv__io_poll(uv_loop_t* loop, int timeout) { uv__loop_internal_fields_t* lfields; struct epoll_event events[1024]; +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) + __msan_unpoison(events, 1024); +#endif +#endif struct epoll_event prep[256]; struct uv__invalidate inv; struct epoll_event* pe; diff --git a/src/unix/signal.c b/src/unix/signal.c index 91fb149464e..bcd15f48208 100644 --- a/src/unix/signal.c +++ b/src/unix/signal.c @@ -62,16 +62,6 @@ RB_GENERATE_STATIC(uv__signal_tree_s, static void uv__signal_global_reinit(void); static void uv__signal_global_init(void) { - if (uv__signal_lock_pipefd[0] == -1) - /* pthread_atfork can register before and after handlers, one - * for each child. This only registers one for the child. That - * state is both persistent and cumulative, so if we keep doing - * it the handler functions will be called multiple times. Thus - * we only want to do it once. - */ - if (pthread_atfork(NULL, NULL, &uv__signal_global_reinit)) - abort(); - uv__signal_global_reinit(); }