X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/a48c5dd5268dc3f67165670e4e4e550f6fa6816a..e6f59cdaeb525222d0a062f07fe3ae8b1b7e5167:/sys/netinet/tcp_timer2.h diff --git a/sys/netinet/tcp_timer2.h b/sys/netinet/tcp_timer2.h index ad2ce4c933..32abc96ba4 100644 --- a/sys/netinet/tcp_timer2.h +++ b/sys/netinet/tcp_timer2.h @@ -40,6 +40,14 @@ #ifdef _KERNEL +#ifndef _SYS_PARAM_H_ +#include +#endif + +#ifndef _SYS_SYSTM_H_ +#include +#endif + #ifndef _SYS_THREAD2_H_ #include #endif @@ -59,12 +67,12 @@ static __inline void tcp_callout_stop(struct tcpcb *_tp, struct tcp_callout *_tc) { + KKASSERT(_tp->tt_msg->tt_cpuid == mycpuid); + crit_enter(); callout_stop(&_tc->tc_callout); - if (_tp->tt_msg != NULL) { - _tp->tt_msg->tt_tasks &= ~_tc->tc_task; - _tp->tt_msg->tt_running_tasks &= ~_tc->tc_task; - } + _tp->tt_msg->tt_tasks &= ~_tc->tc_task; + _tp->tt_msg->tt_running_tasks &= ~_tc->tc_task; crit_exit(); } @@ -72,12 +80,12 @@ static __inline void tcp_callout_reset(struct tcpcb *_tp, struct tcp_callout *_tc, int _to_ticks, void (*_func)(void *)) { + KKASSERT(_tp->tt_msg->tt_cpuid == mycpuid); + crit_enter(); callout_reset(&_tc->tc_callout, _to_ticks, _func, _tp); - if (_tp->tt_msg != NULL) { - _tp->tt_msg->tt_tasks &= ~_tc->tc_task; - _tp->tt_msg->tt_running_tasks &= ~_tc->tc_task; - } + _tp->tt_msg->tt_tasks &= ~_tc->tc_task; + _tp->tt_msg->tt_running_tasks &= ~_tc->tc_task; crit_exit(); } @@ -86,9 +94,11 @@ tcp_callout_active(struct tcpcb *_tp, struct tcp_callout *_tc) { int _act; + KKASSERT(_tp->tt_msg->tt_cpuid == mycpuid); + crit_enter(); _act = callout_active(&_tc->tc_callout); - if (!_act && _tp->tt_msg != NULL) { + if (!_act) { _act = (_tp->tt_msg->tt_tasks | _tp->tt_msg->tt_running_tasks) & _tc->tc_task; } @@ -97,8 +107,10 @@ tcp_callout_active(struct tcpcb *_tp, struct tcp_callout *_tc) } static __inline int -tcp_callout_pending(struct tcpcb *_tp __unused, struct tcp_callout *_tc) +tcp_callout_pending(struct tcpcb *_tp, struct tcp_callout *_tc) { + KKASSERT(_tp->tt_msg->tt_cpuid == mycpuid); + return callout_pending(&_tc->tc_callout); }