diff options
author | Christopher Faylor <me@cgf.cx> | 2002-10-22 20:16:31 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-10-22 20:16:31 +0000 |
commit | d525130f0403aff59eca72693d9a15648741e88e (patch) | |
tree | 16549d8075aa4ee8df6f5f6c64717b4218072640 /winsup/cygwin/dcrt0.cc | |
parent | 329b9ead3ea5a48d452ce48538a4584835c70555 (diff) | |
download | cygnal-d525130f0403aff59eca72693d9a15648741e88e.tar.gz cygnal-d525130f0403aff59eca72693d9a15648741e88e.tar.bz2 cygnal-d525130f0403aff59eca72693d9a15648741e88e.zip |
* cygthread.cc (cygthread::exiting): New variable.
(cygthread::initialized): Delete.
(cygthread::stub): Use exiting variable to determine when to exit.
(cygthread::runner): Delete.
(cygthread_protect): New variable.
(cygthread::init): Don't start runner thread. Initialize muto for list
protection.
(cygthread::freerange): Return pointer to cygthread.
(cygthread::operator new): Change logic to start threads on an as-needed basis.
(cygthread::detach): Don't zero id.
(cygthread::terminate): Don't kill any executing threads. Just set exiting
flag.
* cygthread.h (cygthread): Reflect above changes.
* dcrt0.cc (dll_crt0_1): Move cygthread initialization later.
* fork.cc (fork_child): Do fdtab fixup after dll fixup or (apparently) winsock
may allocate memory in dll load address.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 89c9a4456..22899e452 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -573,10 +573,7 @@ dll_crt0_1 () char **envp = NULL; if (!child_proc_info) - { - cygthread::init (); - memory_init (); - } + memory_init (); else { bool close_ppid_handle = false; @@ -587,7 +584,6 @@ dll_crt0_1 () alloc_stack (fork_info); cygheap_fixup_in_child (0); memory_init (); - cygthread::init (); set_myself (mypid); close_ppid_handle = !!child_proc_info->pppid_handle; break; @@ -600,7 +596,6 @@ dll_crt0_1 () hexec_proc = spawn_info->hexec_proc; around: HANDLE h; - cygthread::init (); cygheap_fixup_in_child (1); memory_init (); if (!spawn_info->moreinfo->myself_pinfo || @@ -621,7 +616,6 @@ 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) @@ -632,6 +626,7 @@ dll_crt0_1 () ProtectHandle (hMainProc); ProtectHandle (hMainThread); + cygthread::init (); /* Initialize debug muto, if DLL is built with --enable-debugging. Need to do this before any helper threads start. */ |