* 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

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