From a85860b5c868d7c3865e5d912916e51a55014ac7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 19 Oct 2002 00:57:06 +0000 Subject: * dcrt0.cc (dll_crt0_1): Initialize cygwin threads here only when not forking. * fork.cc (fork_child): Initialize cygwin thread later in process to avoid allocating memory for thread stacks. * shared.cc (open_shared): Issue warning if NT and shared segment is relocated. --- winsup/cygwin/fork.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fork.cc') diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 0d57bc41e..729de1d8b 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -30,6 +30,7 @@ details. */ #include "sync.h" #include "shared_info.h" #include "cygmalloc.h" +#include "cygthread.h" #ifdef DEBUGGING static int npid; @@ -284,7 +285,6 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) api_fatal ("recreate_mmaps_after_fork_failed"); pinfo_fixup_after_fork (); - signal_fixup_after_fork (); MALLOC_CHECK; @@ -307,6 +307,9 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) if (fixup_shms_after_fork ()) api_fatal ("recreate_shm areas after fork failed"); + cygthread::init (); + signal_fixup_after_fork (); + /* Set thread local stuff to zero. Under Windows 95/98 this is sometimes non-zero, for some reason. FIXME: There is a memory leak here after a fork. */ -- cgit v1.2.3