]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Close a race that snuck in with the recent changes to fix a LOR between
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 31 Aug 2007 19:01:30 +0000 (19:01 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 31 Aug 2007 19:01:30 +0000 (19:01 +0000)
commit67b158d888a8c27330171999bdd468b6b8cd4783
treeb8d8e434794ffd20b69e404fb79c0f23f5d23953
parentd5b6981e699ad3e1a59d75eca6752b9ae33e71fc
Close a race that snuck in with the recent changes to fix a LOR between
the callout_lock spin lock and the sleepqueue spin locks.  In the fix,
callout_drain() has to drop the callout_lock so it can acquire the
sleepqueue lock.  The state of the callout can change while the
callout_lock is held however (for example, it can be rescheduled via
callout_reset()).  The previous code assumed that the only state change
that could happen is that the callout could finish executing.  This change
alters callout_drain() to effectively restart and recheck everything
after it acquires the sleepqueue lock thus handling all the possible
states that the callout could be in after any changes while callout_lock
was dropped.

Approved by: re (kensmith)
Tested by: kris
sys/kern/kern_timeout.c