From 2b3fc7325c6606b3231ad3d530e5bbed680b5af8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 29 Jul 2005 14:29:33 +0000 Subject: [PATCH] * cygthread.cc (cygthread::simplestub): Wait for h to be filled out by main thread before assigning it. --- winsup/cygwin/ChangeLog | 7 ++++++- winsup/cygwin/cygthread.cc | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0a79875c8..ebf673ecc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,4 +1,9 @@ -2005-07-29 Christopher Faylor +2005-07-29 Arto Huusko + + * cygthread.cc (cygthread::simplestub): Wait for h to be filled out + by main thread before assigning it. + +2005-07-29 Arto Huusko * pinfo.cc (pinfo::init): Sleep before retrying open_shared(). diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index 80fa4546d..6763d7283 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -111,6 +111,9 @@ cygthread::simplestub (VOID *arg) cygthread *info = (cygthread *) arg; _my_tls._ctinfo = info; info->stack_ptr = &arg; + /* Wait for main thread to assign 'h' */ + while (!info->h) + low_priority_sleep (0); info->ev = info->h; info->func (info->arg == cygself ? info : info->arg); return 0;