From owner-cvs-src@FreeBSD.ORG Thu Jan 15 23:10:31 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91EE516A4CE; Thu, 15 Jan 2004 23:10:31 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAFFB43D6A; Thu, 15 Jan 2004 23:10:30 -0800 (PST) (envelope-from mtm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0G7AU0B031779; Thu, 15 Jan 2004 23:10:30 -0800 (PST) (envelope-from mtm@repoman.freebsd.org) Received: (from mtm@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0G7AUKL031778; Thu, 15 Jan 2004 23:10:30 -0800 (PST) (envelope-from mtm) Message-Id: <200401160710.i0G7AUKL031778@repoman.freebsd.org> From: Mike Makonnen Date: Thu, 15 Jan 2004 23:10:30 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libthr/thread thr_rwlock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2004 07:10:31 -0000 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