simple multithread program fails on Cygwin, succeeds on Linux

Nicholas Sherlock n.sherlock@gmail.com
Mon Aug 10 12:32:00 GMT 2009


Bruno Haible wrote:
> Hi,
> 
> The attached test program for pthread_once uses the following basic POSIX
> threads functions:
>   pthread_create
>   pthread_join
>   pthread_mutex_init
>   pthread_mutex_lock
>   pthread_mutex_unlock
>   pthread_once
>   pthread_rwlock_init
>   pthread_rwlock_rdlock
>   pthread_rwlock_unlock
>   pthread_rwlock_wrlock

In Cygwin 1.5 there was a bug that meant that you could not lock a 
rwlock recursively for read (it would just deadlock on the second 
acquire). I didn't study the code for very long, but this might be the 
problem you're encountering. In any case, Cygwin 1.7 fixes at least one 
problem with rwlocks so it's a good upgrade choice.

Cheers,
Nicholas Sherlock


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list