Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-15 17:38:12 +0300
committerChristopher Faylor <me@cgf.cx>2003-12-15 17:38:12 +0300
commit5c07a5745f47771a1e460a954c4744e9de4fd164 (patch)
treeac180c44f3ec1e1b7e696e242e200413e2b4266b
parent5e2a359c44421e26dc0ebdd8ed408e398a9c11a8 (diff)
* thread.cc (pthread::init_main_thread): Make sure that the main thread has
valid handles. (pthread::create_cancel_event): Fix error message.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/thread.cc7
2 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0cc668ca9..0d0579c5e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* winsup.h (access_worker): Declare with added fhandler_base parameter.
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 93bf701ac..ca2e3bfaf 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -231,9 +231,10 @@ pthread::init_mainthread ()
if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
GetCurrentProcess (), &thread->win32_obj_id,
0, FALSE, DUPLICATE_SAME_ACCESS))
- thread->win32_obj_id = NULL;
+ api_fatal ("failed to create mainthread handle");
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 ();
}
@@ -289,7 +290,7 @@ pthread::create_cancel_event ()
cancel_event = ::CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
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 */
return false;
}