From 94d49ed31c39002335eeee65d42463139f561954 Mon Sep 17 00:00:00 2001 From: Masaki Matsushita Date: Thu, 26 Nov 2020 16:07:28 +0900 Subject: Add a hook before fork() for getaddrinfo_a() We need stop worker threads in getaddrinfo_a() before fork(). This change adds a hook before fork() that cancel all outstanding requests and wait for all ongoing requests. Then, it waits for all worker threads to be finished. Fixes [Bug #17220] --- include/ruby/internal/intern/process.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ruby/internal/intern/process.h b/include/ruby/internal/intern/process.h index 2b1005a205..5cc0ca242e 100644 --- a/include/ruby/internal/intern/process.h +++ b/include/ruby/internal/intern/process.h @@ -28,6 +28,8 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() /* process.c */ +RUBY_EXTERN void (* rb_socket_before_exec_func)(); + void rb_last_status_set(int status, rb_pid_t pid); VALUE rb_last_status_get(void); int rb_proc_exec(const char*); -- cgit v1.2.3