Page MenuHomeFreeBSD

Add a callout_func_t typedef for functions used with callout_*().
ClosedPublic

Authored by jhb on Dec 10 2019, 7:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Unknown Object (File)
Sun, Oct 12, 7:55 PM
Unknown Object (File)
Fri, Oct 10, 12:47 AM
Unknown Object (File)
Sun, Sep 28, 5:29 PM
Unknown Object (File)
Sep 15 2025, 1:47 PM
Unknown Object (File)
Sep 12 2025, 9:47 AM
Subscribers

Details

Summary

This typedef is the same a timeout_t except that it is in the callout
namespace and header.

Use this typedef in various places of the callout implementation that
were either using the raw type or timeout_t.

While here, add <sys/callout.h> to the manpage.

Test Plan
  • booted an amd64 VM in bhyve

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

.Dd bump is the only thing I see...

This revision is now accepted and ready to land.Dec 10 2019, 7:16 PM
kib added inline comments.
sys/kern/kern_timeout.c
148 ↗(On Diff #65463)

The drain function is somewhat strange to convert to the same typedef as callout, but ok.

771 ↗(On Diff #65463)

Fix style while there, move local declaration to the start of the function ?

bcr added a subscriber: bcr.

My own callout is this: approved! ;-)

jhb marked an inline comment as done.Dec 10 2019, 9:30 PM
jhb added inline comments.
sys/kern/kern_timeout.c
148 ↗(On Diff #65463)

While I agree it is strange, the drain function pointer is saved in c_func by callout_drain_async(), and the manpage before my change used timeout_t for the drain function argument to callout_drain_async(). Given those, it seemed reasonable to me to use the typedef for the drain function pointers.