* 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.
This commit is contained in:
Christopher Faylor
2002-10-19 00:57:06 +00:00
parent 824166e620
commit a85860b5c8
4 changed files with 22 additions and 4 deletions

View File

@@ -573,7 +573,10 @@ dll_crt0_1 ()
char **envp = NULL;
if (!child_proc_info)
memory_init ();
{
memory_init ();
cygthread::init ();
}
else
{
bool close_ppid_handle = false;
@@ -616,6 +619,7 @@ dll_crt0_1 ()
old_title = strcpy (title_buf, spawn_info->moreinfo->old_title);
cfree (spawn_info->moreinfo->old_title);
}
cygthread::init ();
break;
}
if (close_hexec_proc)
@@ -624,8 +628,6 @@ dll_crt0_1 ()
CloseHandle (child_proc_info->pppid_handle);
}
cygthread::init ();
ProtectHandle (hMainProc);
ProtectHandle (hMainThread);