Date: Thu, 15 Jan 2004 23:10:30 -0800 (PST) From: Mike Makonnen <mtm@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libthr/thread thr_rwlock.c Message-ID: <200401160710.i0G7AUKL031778@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
mtm 2004/01/15 23:10:30 PST FreeBSD src repository Modified files: lib/libthr/thread thr_rwlock.c Log: o We are not required to initialize an invalid rwlock. So axe all that code and simply return EINVAL (which is allowed by the standard) in all those pthread functions that previously initialized it. o Refactor the pthread_rwlock_[try]rdlock() and pthread_rwlock_[try]wrlock() functions. They are now completeley condensed into rwlock_rdlock_common() and rwlock_wrlock_common(), respectively. o If the application tries to destroy an rwlock that is currently held by a thread return EBUSY where it previously went ahead and freed all resources associated with the lock. o Refactor _pthread_rwlock_init() to make it look (relatively) sane. o When obtaining a read lock on an rwlock the check for whether it would exceed the maximum allowed read locks should happen *before* we obtain the lock. o The pthread_rwlock_* functions shall *never* return EINTR, so make sure to requeue/resuspend the thread if it encounters such an error. o Make a note that pthread_rwlock_unlock() needs to ensure it holds a lock on an rwlock it tries to unlock. It will be implemented in a separate commit because it requires some additional rwlock infrastructure. Revision Changes Path 1.2 +93 -160 src/lib/libthr/thread/thr_rwlock.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401160710.i0G7AUKL031778>