This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
Re: pthread_cond_broadcast(...) leads to a deadlock
- From: Ross Johnson <rpj at callisto dot canberra dot edu dot au>
- To: "'pthreads-win32 at sources dot redhat dot com'" <pthreads-win32 at sources dot redhat dot com>
- Date: Fri, 19 Nov 2004 18:47:01 +1100
- Subject: Re: pthread_cond_broadcast(...) leads to a deadlock
- References: <715D092C2A9AD411B4DD006097C6EE8401482C8F@EXCHSVR>
- Reply-to: rpj at callisto dot canberra dot edu dot au
Alex Kotliarov wrote:
- any reason why pthread_mutex_lock (cleanup_args->mutexPtr) was moved
to the top? Algorithm 8A has this line at the bottom of
ptw32_cond_wait_cleanup()
I read, in an authoritative forum, that the external mutex is required
to be held during cv cancel cleanup. The cleanup routine is also part of
the normal cv wake-up logic but the change passed the test suite and so
it seemed safe. I don't know if it's still a potential conformance
problem, but this change obviously wasn't the solution.
The current version of pthread_cond_wait.c with the change undone is in CVS:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/pthreads/pthread_cond_wait.c?rev=1.8&content-type=text/plain&cvsroot=pthreads-win32
Apologies.
Ross
Thanks,
Alexander Kotliarov.