Throughout, revert ill-conceived replacement of hMainThread with
GetCurrentThread/NtCurrentThread. * dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread again.
This commit is contained in:
parent
57a2873a5d
commit
1b71ce005c
|
@ -1,3 +1,10 @@
|
||||||
|
2009-12-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
Throughout, revert ill-conceived replacement of hMainThread with
|
||||||
|
GetCurrentThread/NtCurrentThread.
|
||||||
|
* dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread
|
||||||
|
again.
|
||||||
|
|
||||||
2009-12-19 Corinna Vinschen <corinna@vinschen.de>
|
2009-12-19 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_console.cc (__vt100_conv): Minor formatting change.
|
* fhandler_console.cc (__vt100_conv): Minor formatting change.
|
||||||
|
|
|
@ -695,6 +695,10 @@ dll_crt0_0 ()
|
||||||
user_data->impure_ptr = _impure_ptr;
|
user_data->impure_ptr = _impure_ptr;
|
||||||
user_data->impure_ptr_ptr = &_impure_ptr;
|
user_data->impure_ptr_ptr = &_impure_ptr;
|
||||||
|
|
||||||
|
DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
|
||||||
|
GetCurrentProcess (), &hMainThread,
|
||||||
|
0, false, DUPLICATE_SAME_ACCESS);
|
||||||
|
|
||||||
OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &hProcToken);
|
OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &hProcToken);
|
||||||
set_cygwin_privileges (hProcToken);
|
set_cygwin_privileges (hProcToken);
|
||||||
|
|
||||||
|
@ -781,6 +785,8 @@ dll_crt0_1 (void *)
|
||||||
small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
|
small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ProtectHandle (hMainThread);
|
||||||
|
|
||||||
cygheap->cwd.init ();
|
cygheap->cwd.init ();
|
||||||
|
|
||||||
/* Initialize pthread mainthread when not forked and it is safe to call new,
|
/* Initialize pthread mainthread when not forked and it is safe to call new,
|
||||||
|
|
|
@ -484,7 +484,7 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
|
||||||
|
|
||||||
if (debugging && ++debugging < 500000)
|
if (debugging && ++debugging < 500000)
|
||||||
{
|
{
|
||||||
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_NORMAL);
|
SetThreadPriority (hMainThread, THREAD_PRIORITY_NORMAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1307,7 +1307,7 @@ exit_sig:
|
||||||
{
|
{
|
||||||
CONTEXT c;
|
CONTEXT c;
|
||||||
c.ContextFlags = CONTEXT_FULL;
|
c.ContextFlags = CONTEXT_FULL;
|
||||||
GetThreadContext (GetCurrentThread (), &c);
|
GetThreadContext (hMainThread, &c);
|
||||||
use_tls->copy_context (&c);
|
use_tls->copy_context (&c);
|
||||||
si.si_signo |= 0x80;
|
si.si_signo |= 0x80;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ details. */
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <cygwin/version.h>
|
#include <cygwin/version.h>
|
||||||
|
|
||||||
|
HANDLE NO_COPY hMainThread;
|
||||||
HANDLE NO_COPY hProcToken;
|
HANDLE NO_COPY hProcToken;
|
||||||
HANDLE NO_COPY hProcImpToken;
|
HANDLE NO_COPY hProcImpToken;
|
||||||
HMODULE NO_COPY cygwin_hmodule;
|
HMODULE NO_COPY cygwin_hmodule;
|
||||||
|
|
|
@ -253,7 +253,7 @@ low_priority_sleep (DWORD secs)
|
||||||
if (GetCurrentThreadId () == cygthread::main_thread_id)
|
if (GetCurrentThreadId () == cygthread::main_thread_id)
|
||||||
new_prio = THREAD_PRIORITY_LOWEST;
|
new_prio = THREAD_PRIORITY_LOWEST;
|
||||||
else
|
else
|
||||||
new_prio = GetThreadPriority (GetCurrentThread ());
|
new_prio = GetThreadPriority (hMainThread);
|
||||||
|
|
||||||
if (curr_prio != new_prio)
|
if (curr_prio != new_prio)
|
||||||
/* Force any threads in normal priority to be scheduled */
|
/* Force any threads in normal priority to be scheduled */
|
||||||
|
|
Loading…
Reference in New Issue