* cygthread.cc (cygthread::terminate_thread): Only try to free
thread stack on systems not freeing it by themselves. * wincap.h (wincaps::terminate_thread_frees_stack): New element. * wincap.cc: Implement above element throughout.
This commit is contained in:
parent
bb93b7ab95
commit
4aa4632ad2
|
@ -1,3 +1,10 @@
|
||||||
|
2013-03-29 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygthread.cc (cygthread::terminate_thread): Only try to free
|
||||||
|
thread stack on systems not freeing it by themselves.
|
||||||
|
* wincap.h (wincaps::terminate_thread_frees_stack): New element.
|
||||||
|
* wincap.cc: Implement above element throughout.
|
||||||
|
|
||||||
2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx>
|
2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx>
|
||||||
|
|
||||||
* pinfo.h (pinfo::status_exit): Rename from former static function in
|
* pinfo.h (pinfo::status_exit): Rename from former static function in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* cygthread.cc
|
/* cygthread.cc
|
||||||
|
|
||||||
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009,
|
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009,
|
||||||
2010, 2011, 2012 Red Hat, Inc.
|
2010, 2011, 2012, 2013 Red Hat, Inc.
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of the
|
This software is a copyrighted work licensed under the terms of the
|
||||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||||
|
@ -313,6 +313,8 @@ cygthread::terminate_thread ()
|
||||||
if (ev && !(terminated = !IsEventSignalled (ev)))
|
if (ev && !(terminated = !IsEventSignalled (ev)))
|
||||||
ResetEvent (ev);
|
ResetEvent (ev);
|
||||||
|
|
||||||
|
if (!wincap.terminate_thread_frees_stack ())
|
||||||
|
{
|
||||||
MEMORY_BASIC_INFORMATION m;
|
MEMORY_BASIC_INFORMATION m;
|
||||||
memset (&m, 0, sizeof (m));
|
memset (&m, 0, sizeof (m));
|
||||||
VirtualQuery (stack_ptr, &m, sizeof m);
|
VirtualQuery (stack_ptr, &m, sizeof m);
|
||||||
|
@ -322,6 +324,7 @@ cygthread::terminate_thread ()
|
||||||
else if (!VirtualFree (m.AllocationBase, 0, MEM_RELEASE))
|
else if (!VirtualFree (m.AllocationBase, 0, MEM_RELEASE))
|
||||||
debug_printf ("VirtualFree of allocation base %p<%p> failed, %E",
|
debug_printf ("VirtualFree of allocation base %p<%p> failed, %E",
|
||||||
stack_ptr, m.AllocationBase);
|
stack_ptr, m.AllocationBase);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_freerange)
|
if (is_freerange)
|
||||||
free (this);
|
free (this);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
capability class to the appropriate values.
|
capability class to the appropriate values.
|
||||||
|
|
||||||
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||||
2012 Red Hat, Inc.
|
2012, 2013 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:true,
|
kernel_is_always_casesensitive:true,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -91,6 +92,7 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) =
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:true,
|
kernel_is_always_casesensitive:true,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -126,6 +128,7 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -161,6 +164,7 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -196,6 +200,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -231,6 +236,7 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:true,
|
wow64_has_secondary_stack:true,
|
||||||
has_program_compatibility_assistant:false,
|
has_program_compatibility_assistant:false,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:false,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -266,6 +272,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:true,
|
has_program_compatibility_assistant:true,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:true,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -301,6 +308,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:true,
|
has_program_compatibility_assistant:true,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:true,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
|
@ -336,6 +344,7 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||||
wow64_has_secondary_stack:false,
|
wow64_has_secondary_stack:false,
|
||||||
has_program_compatibility_assistant:true,
|
has_program_compatibility_assistant:true,
|
||||||
kernel_is_always_casesensitive:false,
|
kernel_is_always_casesensitive:false,
|
||||||
|
terminate_thread_frees_stack:true,
|
||||||
};
|
};
|
||||||
|
|
||||||
wincapc wincap __attribute__((section (".cygwin_dll_common"), shared));
|
wincapc wincap __attribute__((section (".cygwin_dll_common"), shared));
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* wincap.h: Header for OS capability class.
|
/* wincap.h: Header for OS capability class.
|
||||||
|
|
||||||
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||||
2012 Red Hat, Inc.
|
2012, 2013 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ struct wincaps
|
||||||
unsigned wow64_has_secondary_stack : 1;
|
unsigned wow64_has_secondary_stack : 1;
|
||||||
unsigned has_program_compatibility_assistant : 1;
|
unsigned has_program_compatibility_assistant : 1;
|
||||||
unsigned kernel_is_always_casesensitive : 1;
|
unsigned kernel_is_always_casesensitive : 1;
|
||||||
|
unsigned terminate_thread_frees_stack : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
class wincapc
|
class wincapc
|
||||||
|
@ -100,6 +101,7 @@ public:
|
||||||
bool IMPLEMENT (wow64_has_secondary_stack)
|
bool IMPLEMENT (wow64_has_secondary_stack)
|
||||||
bool IMPLEMENT (has_program_compatibility_assistant)
|
bool IMPLEMENT (has_program_compatibility_assistant)
|
||||||
bool IMPLEMENT (kernel_is_always_casesensitive)
|
bool IMPLEMENT (kernel_is_always_casesensitive)
|
||||||
|
bool IMPLEMENT (terminate_thread_frees_stack)
|
||||||
|
|
||||||
#undef IMPLEMENT
|
#undef IMPLEMENT
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue