* cygthread.cc (cygthread::simplestub): Wait for h to be filled out by main

thread before assigning it.
This commit is contained in:
Christopher Faylor 2005-07-29 14:29:33 +00:00
parent 40c125cf38
commit 2b3fc7325c
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,9 @@
2005-07-29 Christopher Faylor <cgf@timesys.com>
2005-07-29 Arto Huusko <arto.huusko@wmdata.fi>
* cygthread.cc (cygthread::simplestub): Wait for h to be filled out
by main thread before assigning it.
2005-07-29 Arto Huusko <arto.huusko@wmdata.fi>
* pinfo.cc (pinfo::init): Sleep before retrying open_shared().

View File

@ -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;