diff options
| author | Ryan Fahy <ryan@rfahy.com> | 2026-09-13 07:39:48 +0000 |
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2026-09-13 07:39:48 +0000 |
| commit | 79e290d967862bef1adcf39f0bfcf1b4993a8202 (patch) | |
| tree | 992cbd48c4d2d6f8c3632635e2b006859e3feb1c /source/compiler/(public-mirror) | |
| parent | 5fe1964fa05632cb86459a64debd92f9dca37ed3 (diff) | |
Align behavior between the Linux cancel_delayed_work_sync()
function return value and the LinuxKPI equivalent.
Linux cancel_delayed_work_sync() returns whether delayed
work was pending, even if canceled before executing. This
includes the case where the timer fired and work was queued
but the callback had not yet started.
The LinuxKPI version used the return value from taskqueue_cancel()
as the return value of the public facing API, which inverted the
behavior of two cases, violating the Linux API contract.
Queued work which was removed before running would return false, and
work whose callback was already executing would return true.
Track the taskqueue pending count separately from the
taskqueue_cancel() return value.
Use the pending count for the public return value.
Use taskqueue_cancel() return value only to decide whether
state needs to be re-checked.
This fixes behavior in consumers which use the return value of
cancel_delayed_work_sync() to distinguish canceled pending
work from work that was already running or idle.
Signed-off-by: Ryan Fahy <ryan@rfahy.com>
Reviewed by: wulf
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2268
Diffstat (limited to 'source/compiler/(public-mirror)')
0 files changed, 0 insertions, 0 deletions
