]> git.ipfire.org Git - thirdparty/bind9.git/commit
fix: dev: Fix a bug in isc_rwlock_trylock()
authorArаm Sаrgsyаn <aram@isc.org>
Wed, 8 Jan 2025 10:29:14 +0000 (10:29 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Wed, 8 Jan 2025 10:29:14 +0000 (10:29 +0000)
commitf68e60b3dc433714e4d08a0c0149e89c91fa586d
treef954f041c0b45e33be6d2a0eb764cae937231f82
parent333834e764e99dbcdceac6afac3b940f97e6d80f
parent73b6d9e9e5c3405b8f2cd6ab1e999e2a5d756875
fix: dev: Fix a bug in isc_rwlock_trylock()

When isc_rwlock_trylock() fails to get a read lock because another
writer was faster, it should wake up other waiting writers in case
there are no other readers, but the current code forgets about
the currently active writer when evaluating 'cntflag'.

Unset the WRITER_ACTIVE bit in 'cntflag' before checking to see if
there are other readers, otherwise the waiting writers, if they exist,
might not wake up.

Closes #5121

Merge branch 'aram/isc_rwlock_trylock-bugfix-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9937