Subject: Re: [PATCH v3] Threaded grep

From: Johannes Sixt <[email-masked]>
Date: Mon, 18 Jan 2010 14:45:44 +0100

Fredrik Kuivinen schrieb:
> On Mon, Jan 18, 2010 at 12:11, Johannes Sixt <[email-masked]> wrote:
>> Fredrik Kuivinen schrieb:
>>> +     pthread_mutex_unlock(&grep_lock);
>>> +     pthread_cond_signal(&cond_add);
>> Please swap these two lines, so that pthread_cond_signal() is called while
>> the lock is held.
> 
> May I ask why? (just curious)

Because our pthreads_cond_* functions on Windows are not POSIXly correct
and work reliably only when pthread_cond_signal() is called while the
mutex is held.

-- Hannes