diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-09-14 10:52:26 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-09-14 10:52:26 +0000 |
commit | 1a99c0928d2542d03995cea75e0ac0da4a347e31 (patch) | |
tree | 68672490f99e5c549ab2b41d07eaaaafa9032742 /sys/sys/callout.h | |
parent | e64a8234e347ea26e7285c6a808a390b35968e14 (diff) | |
download | FreeBSD-src-1a99c0928d2542d03995cea75e0ac0da4a347e31.zip FreeBSD-src-1a99c0928d2542d03995cea75e0ac0da4a347e31.tar.gz |
Implement callout_drain_async(), inspired by the projects/hps_head
branch.
This function is used to drain a callout via a callback instead of
blocking the caller until the drain is complete. Refer to the
callout_drain_async() manual page for a detailed description.
Limitation: If a lock is used with the callout, the callout can only
be drained asynchronously one time unless the callout_init_mtx()
function is called again. This limitation is not present in
projects/hps_head and will require more invasive changes to the
timeout code, which was not in the scope of this patch.
Differential Revision: https://reviews.freebsd.org/D3521
Reviewed by: wblock
MFC after: 1 month
Diffstat (limited to 'sys/sys/callout.h')
-rw-r--r-- | sys/sys/callout.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/callout.h b/sys/sys/callout.h index 5e21164..f2841e8 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -82,6 +82,7 @@ struct callout_handle { #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) +int callout_drain_async(struct callout *, callout_func_t *, void *); void callout_init(struct callout *, int); void _callout_init_lock(struct callout *, struct lock_object *, int); #define callout_init_mtx(c, mtx, flags) \ |