summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/getw.c
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-01-19 14:51:45 +0000
committermtm <mtm@FreeBSD.org>2004-01-19 14:51:45 +0000
commit2d3f49ebd38d6441b693d51adcf071088817ddf5 (patch)
tree8ea09bd49e1effae3ff537f35c5766a1cdc3bf69 /lib/libc/stdio/getw.c
parentfc6eb88ff293065b8973e0a33349d6ee1547181c (diff)
downloadFreeBSD-src-2d3f49ebd38d6441b693d51adcf071088817ddf5.zip
FreeBSD-src-2d3f49ebd38d6441b693d51adcf071088817ddf5.tar.gz
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 ]
Diffstat (limited to 'lib/libc/stdio/getw.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud