cvs commit: src/lib/libthr/thread thr_rwlock.c
Mike Makonnen
mtm at FreeBSD.org
Thu Jan 15 23:10:31 PST 2004
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
More information about the cvs-src
mailing list