]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
o We are not required to initialize an invalid rwlock. So axe all that
authorMike Makonnen <mtm@FreeBSD.org>
Fri, 16 Jan 2004 07:10:30 +0000 (07:10 +0000)
committerMike Makonnen <mtm@FreeBSD.org>
Fri, 16 Jan 2004 07:10:30 +0000 (07:10 +0000)
commit14f8ddcd0820ceb19ba3dc304103631549ae222a
tree67558545424cfa8714d32f850d9725b71436ae5c
parenta971a192626cdd8378570f8c6d8c66482ccf26aa
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.
lib/libthr/thread/thr_rwlock.c