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)
Fri, Jan 24, 7:11 PM
Unknown Object (File)
Sat, Jan 18, 5:48 PM
Unknown Object (File)
Dec 28 2024, 5:41 AM
Unknown Object (File)
Dec 27 2024, 12:47 PM
Unknown Object (File)
Dec 7 2024, 8:39 PM
Unknown Object (File)
Nov 29 2024, 3:12 AM
Unknown Object (File)
Nov 22 2024, 5:54 PM
Unknown Object (File)
Nov 20 2024, 3:24 PM
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.