aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-10-14 02:37:49 +0000
committerChristopher Faylor <me@cgf.cx>2002-10-14 02:37:49 +0000
commita7a5d0ba3742911e0ab9dfeed077631f25bb257f (patch)
tree197c4c67ceee68a2e304b5f2c4d8f01a0b543834 /winsup/cygwin
parent5c2b46f4a80af84d5676c321687c121dc61dd21b (diff)
downloadnewlib-a7a5d0ba3742911e0ab9dfeed077631f25bb257f.zip
newlib-a7a5d0ba3742911e0ab9dfeed077631f25bb257f.tar.gz
newlib-a7a5d0ba3742911e0ab9dfeed077631f25bb257f.tar.bz2
* cygthread.cc (cygthread::stub): Don't zero __name here. That introduces a
race.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/cygthread.cc21
2 files changed, 18 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index df2e66b..8eb5d93 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2002-10-13 Christopher Faylor <cgf@redhat.com>
+ * cygthread.cc (cygthread::stub): Don't zero __name here. That
+ introduces a race.
+
+2002-10-13 Christopher Faylor <cgf@redhat.com>
+
* include/cygwin/version.h: Bump DLL minor number.
2002-10-13 Christopher Faylor <cgf@redhat.com>
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index ec217b7..ce64a74 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -44,21 +44,26 @@ cygthread::stub (VOID *arg)
}
while (1)
{
- if (!info->func || initialized < 0)
- ExitThread (0);
+ if (!info->__name)
+ system_printf ("errnoneous thread activation");
+ else
+ {
+ if (!info->func || initialized < 0)
+ ExitThread (0);
- /* Cygwin threads should not call ExitThread directly */
- info->func (info->arg == cygself ? info : info->arg);
- /* ...so the above should always return */
+ /* Cygwin threads should not call ExitThread directly */
+ info->func (info->arg == cygself ? info : info->arg);
+ /* ...so the above should always return */
#ifdef DEBUGGING
- info->func = NULL; // catch erroneous activation
+ info->func = NULL; // catch erroneous activation
#endif
- SetEvent (info->ev);
- info->__name = NULL;
+ SetEvent (info->ev);
+ }
switch (WaitForSingleObject (info->thread_sync, INFINITE))
{
case WAIT_OBJECT_0:
+ // ResetEvent (info->thread_sync);
continue;
default:
api_fatal ("WFSO failed, %E");