Date: Mon, 19 Jan 2004 06:51:45 -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_exit.c thr_private.h thr_rwlock.c Message-ID: <200401191451.i0JEpjT6039692@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
mtm 2004/01/19 06:51:45 PST FreeBSD src repository Modified files: lib/libthr/thread thr_exit.c thr_private.h thr_rwlock.c Log: Implement reference counting of read-write locks. This uses a list in the thread structure to keep track of the locks and how many times they have been locked. This list is checked on every lock and unlock. The traversal through the list is O(n). Most applications don't hold so many locks at once that this will become a problem. However, if it does become a problem it might be a good idea to review this once libthr is off probation and in the optimization cycle. This fixes: o deadlock when a thread tries to recursively acquire a read lock when a writer is waiting on the lock. o a thread could previously successfully unlock a lock it did not own o deadlock when a thread tries to acquire a write lock on a lock it already owns for reading or writing [ this is admittedly not required by POSIX, but is nice to have ] Revision Changes Path 1.11 +6 -0 src/lib/libthr/thread/thr_exit.c 1.29 +16 -0 src/lib/libthr/thread/thr_private.h 1.4 +133 -8 src/lib/libthr/thread/thr_rwlock.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401191451.i0JEpjT6039692>