diff options
author | deischen <deischen@FreeBSD.org> | 2004-01-08 15:37:09 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2004-01-08 15:37:09 +0000 |
commit | b5d5c1e2e6eed84babb0064d131368e6e1f33819 (patch) | |
tree | f5c5e554641a7502ee565fa9bd6da4230affaab6 /lib/libpthread/thread/thr_create.c | |
parent | c71c484186b980c3641d396aa5fc5b735da4e63f (diff) | |
download | FreeBSD-src-b5d5c1e2e6eed84babb0064d131368e6e1f33819.zip FreeBSD-src-b5d5c1e2e6eed84babb0064d131368e6e1f33819.tar.gz |
Add a simple work-around for deadlocking on recursive read locks
on a rwlock while there are writers waiting. We normally favor
writers but when a reader already has at least one other read lock,
we favor the reader. We don't track all the rwlocks owned by a
thread, nor all the threads that own a rwlock -- we just keep
a count of all the read locks owned by a thread.
PR: 24641
Diffstat (limited to 'lib/libpthread/thread/thr_create.c')
-rw-r--r-- | lib/libpthread/thread/thr_create.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index b82f1809..38c2fc4 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -252,6 +252,7 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, sigemptyset(&new_thread->sigpend); new_thread->check_pending = 0; new_thread->locklevel = 0; + new_thread->rdlock_count = 0; new_thread->sigstk.ss_sp = 0; new_thread->sigstk.ss_size = 0; new_thread->sigstk.ss_flags = SS_DISABLE; |