Re: gthread-win32.c



Hi Steven,

> 234                if (retval == WAIT_TIMEOUT)
> 235                  {
> 236                    EnterCriticalSection (&cond->lock);
> 237                    g_ptr_array_remove (cond->array, event);
> 238
> 239                    /* In the meantime we could have been signaled,
> so we must again
> 240                     * wait for the signal, this time with no
> timeout, to reset it */
> 241                    win32_check_for_error (WAIT_FAILED !=
> WaitForSingleObject (event, 0));
> 242
> 243                    LeaveCriticalSection (&cond->lock);
> 244                  }
> 
> Should this not change retval?  If the object has been signalled, then
> it should return successful.  Otherwise, the event which caused the
> object to be signalled is lost.

Yes, right. Should not happen often and even then the current version could be
argued correct, but actually you're right. Fixed.
 
> 462                retval->thread = (HANDLE) _beginthreadex (NULL,
> stack_size, g_thread_proxy,
> 463 wilhelmi 1.1 retval, 0, &ignore);
> 
> Interesting.  Why not use CreateThread?

I just used, what pthreads-win32 used. Also giowin32.c uses that and I
suppose, Tor knew, what he did...

Bye,
Sebastian
-- 
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]