There is a race condition between cygthread::cygthread and
cygthread::simplestub. If cygthread::simplestub is used, it is possible
that "ev" field is never initialized, which leads to hang when
cygthread::operator HANDLE() is called.

2005-07-29  Arto Huusko  <[EMAIL PROTECTED]>

        * cygthread.cc (cygthread::simplestub): fix race.
--- cygthread.cc	2005-07-29 11:30:07.641054271 +0300
+++ cygthread.cc.fixed	2005-07-29 11:30:39.990220737 +0300
@@ -111,6 +111,8 @@ cygthread::simplestub (VOID *arg)
   cygthread *info = (cygthread *) arg;
   _my_tls._ctinfo = info;
   info->stack_ptr = &arg;
+  while (! info->h)
+    low_priority_sleep (0);
   info->ev = info->h;
   info->func (info->arg == cygself ? info : info->arg);
   return 0;

Reply via email to