* thread.cc (pthread::init_main_thread): Make sure that the main thread has

valid handles.
(pthread::create_cancel_event): Fix error message.
This commit is contained in:
Christopher Faylor 2003-12-15 14:38:12 +00:00
parent 5e2a359c44
commit 5c07a5745f
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2003-12-15 Thomas Pfaff <tpfaff@gmx.net>
* thread.cc (pthread::init_main_thread): Make sure that the main thread
has valid handles.
(pthread::create_cancel_event): Fix error message.
2003-12-14 Christopher Faylor <cgf@redhat.com> 2003-12-14 Christopher Faylor <cgf@redhat.com>
* winsup.h (access_worker): Declare with added fhandler_base parameter. * winsup.h (access_worker): Declare with added fhandler_base parameter.

View File

@ -231,9 +231,10 @@ pthread::init_mainthread ()
if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
GetCurrentProcess (), &thread->win32_obj_id, GetCurrentProcess (), &thread->win32_obj_id,
0, FALSE, DUPLICATE_SAME_ACCESS)) 0, FALSE, DUPLICATE_SAME_ACCESS))
thread->win32_obj_id = NULL; api_fatal ("failed to create mainthread handle");
thread->set_tls_self_pointer (); thread->set_tls_self_pointer ();
(void) thread->create_cancel_event (); if (!thread->create_cancel_event ())
api_fatal ("couldn't create cancel event for main thread");
thread->postcreate (); thread->postcreate ();
} }
@ -289,7 +290,7 @@ pthread::create_cancel_event ()
cancel_event = ::CreateEvent (&sec_none_nih, TRUE, FALSE, NULL); cancel_event = ::CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
if (!cancel_event) if (!cancel_event)
{ {
system_printf ("couldn't create cancel event for main thread, %E"); system_printf ("couldn't create cancel event, %E");
/* we need the event for correct behaviour */ /* we need the event for correct behaviour */
return false; return false;
} }