]> git.ipfire.org Git - thirdparty/bind9.git/commit
Make isc_task_pause/isc_task_unpause thread safe.
authorWitold Kręcicki <wpk@isc.org>
Tue, 28 Jan 2020 08:08:10 +0000 (09:08 +0100)
committerWitold Krecicki <wpk@isc.org>
Tue, 18 Feb 2020 09:22:04 +0000 (09:22 +0000)
commit23bd04d2f167e4a99d019cfbeee1881733c12080
tree4694b70b2c21dad8309e1838eb777b6443c38427
parentb9a2b4cb74e5c0d4c9c10bc611c8abe9b16bd48f
Make isc_task_pause/isc_task_unpause thread safe.

isc_task_pause/unpause were inherently thread-unsafe - a task
could be paused only once by one thread, if the task was running
while we paused it it led to races. Fix it by making sure that
the task will pause if requested to, and by using a 'pause reference
counter' to count task pause requests - a task will be unpaused
iff all threads unpause it.

Don't remove from queue when pausing task - we lock the queue lock
(expensive), while it's unlikely that the task will be running -
and we'll remove it anyway in dispatcher
lib/isc/task.c