Subject: Re: lib/26208 (pthread_mutex possible deadlock)
To: None <lib-bug-people@netbsd.org, netbsd-bugs@netbsd.org,>
From: Bill Studenmund <wrstuden@netbsd.org>
List: netbsd-bugs
Date: 08/22/2006 17:55:58
--aT9PWwzfKXlsBJM1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Just to clarify things for posterity, the (now closed) race is that
another thread can be in the process of sleeping on our mutex and stalled
when we call pthread_mutex_unlock(). If said other thread has determined
it needs to go onto the wait list but hasn't yet added itself, and it
would be the first/only waiter on the list, then the test of the wait list
being empty is misleading. Grabbing the lock, as we do now, ensures that
no other thread is in the process of putting itself onto the list and thus
we prevent the race.

Take care,

Bill

--aT9PWwzfKXlsBJM1
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFE66eeWz+3JHUci9cRAqp/AJ40Q7oFsHwLDBkd3kHo4yOKP61uWgCdHI9y
QlfpdMXcOBXZiCgNzV4T2/c=
=3se0
-----END PGP SIGNATURE-----

--aT9PWwzfKXlsBJM1--