MCPcopy Index your code
hub / github.com/F-Stack/f-stack / softclock

Function softclock

freebsd/kern/kern_timeout.c:803–832  ·  view source on GitHub ↗

* Software (low priority) clock interrupt. * Run periodic events from timeout queue. */

Source from the content-addressed store, hash-verified

801 * Run periodic events from timeout queue.
802 */
803void
804softclock(void *arg)
805{
806 struct callout_cpu *cc;
807 struct callout *c;
808#ifdef CALLOUT_PROFILING
809 int depth = 0, gcalls = 0, lockcalls = 0, mpcalls = 0;
810#endif
811
812 cc = (struct callout_cpu *)arg;
813 CC_LOCK(cc);
814 while ((c = TAILQ_FIRST(&cc->cc_expireq)) != NULL) {
815 TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe);
816 softclock_call_cc(c, cc,
817#ifdef CALLOUT_PROFILING
818 &mpcalls, &lockcalls, &gcalls,
819#endif
820 0);
821#ifdef CALLOUT_PROFILING
822 ++depth;
823#endif
824 }
825#ifdef CALLOUT_PROFILING
826 avg_depth += (depth * 1000 - avg_depth) >> 8;
827 avg_mpcalls += (mpcalls * 1000 - avg_mpcalls) >> 8;
828 avg_lockcalls += (lockcalls * 1000 - avg_lockcalls) >> 8;
829 avg_gcalls += (gcalls * 1000 - avg_gcalls) >> 8;
830#endif
831 CC_UNLOCK(cc);
832}
833
834void
835callout_when(sbintime_t sbt, sbintime_t precision, int flags,

Callers

nothing calls this directly

Calls 1

softclock_call_ccFunction · 0.70

Tested by

no test coverage detected