diff options
author | Christopher Faylor <me@cgf.cx> | 2011-04-21 00:53:55 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-04-21 00:53:55 +0000 |
commit | 71c17c540231c3b824474431f2be0bd5ce63005f (patch) | |
tree | 29ddf6d9c57e712238eaca5629fb5524ab24c17b /winsup/cygwin/dll_init.h | |
parent | 2f9c27131fc48d8364e0ef16332cf6e6402c4fdd (diff) | |
download | cygnal-71c17c540231c3b824474431f2be0bd5ce63005f.tar.gz cygnal-71c17c540231c3b824474431f2be0bd5ce63005f.tar.bz2 cygnal-71c17c540231c3b824474431f2be0bd5ce63005f.zip |
* cygheap.cc (init_cygheap::close_ctty): Avoid closing console-cttys since they
don't use archetypes and this will just result in double frees.
* dll_init.cc (dll_list::protect): Define.
(dll_list::alloc): Guard list access.
(dll_list::detach): Ditto.
* dll_init.h (dll_list::protect): Declare new muto.
(dll_list::guard): Define/declare function to guard list access.
* fhandler_termios.cc (fhandler_termios::sigflush): Avoid SEGV in pathological
condition of get_ttyp() == NULL.
Diffstat (limited to 'winsup/cygwin/dll_init.h')
-rw-r--r-- | winsup/cygwin/dll_init.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h index b37406e82..d14cc6cb9 100644 --- a/winsup/cygwin/dll_init.h +++ b/winsup/cygwin/dll_init.h @@ -72,6 +72,7 @@ class dll_list dll *end; dll *hold; dll_type hold_type; + static muto protect; public: dll start; int tot; @@ -90,13 +91,22 @@ public: break; return hold; } + dll *istart (dll_type t) { hold_type = t; hold = &start; return inext (); } + void guard(bool lockit) + { + if (lockit) + protect.acquire (); + else + protect.release (); + } friend void dll_global_dtors (); + dll_list () { protect.init ("dll_list"); } }; extern dll_list dlls; |