Re: [PATCH] MSVC: port pthread code to native Windows threads

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

 



On Wed, Nov 04, 2009 at 02:47:09PM +0100, Andrzej K. Haczewski wrote:
> 2009/11/4 Johannes Sixt <j.sixt@xxxxxxxxxxxxx>:
> 
> > - pthread_cond_signal is called while the mutex is held.
> 
> AFAIK that is a requirement for condition variable to be signaled
> while holding the same mutex that other threads cond_wait on. I just
> don't check that it is true, because Git is locking mutex.

There is no such requirement in POSIX:

   The pthread_cond_broadcast() or pthread_cond_signal() functions may
   be called by a thread whether or not it currently owns the mutex that
   threads calling pthread_cond_wait() or pthread_cond_timedwait() have
   associated with the condition variable during their waits; however,
   if predictable scheduling behavior is required, then that mutex shall
   be locked by the thread calling pthread_cond_broadcast() or
   pthread_cond_signal().

http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cond_signal.html



Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]