MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tty_dealloc

Function tty_dealloc

freebsd/kern/tty.c:1108–1137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1106}
1107
1108static void
1109tty_dealloc(void *arg)
1110{
1111 struct tty *tp = arg;
1112
1113 /*
1114 * ttyydev_leave() usually frees the i/o queues earlier, but it is
1115 * not always called between queue allocation and here. The queues
1116 * may be allocated by ioctls on a pty control device without the
1117 * corresponding pty slave device ever being open, or after it is
1118 * closed.
1119 */
1120 ttyinq_free(&tp->t_inq);
1121 ttyoutq_free(&tp->t_outq);
1122 seldrain(&tp->t_inpoll);
1123 seldrain(&tp->t_outpoll);
1124 knlist_destroy(&tp->t_inpoll.si_note);
1125 knlist_destroy(&tp->t_outpoll.si_note);
1126
1127 cv_destroy(&tp->t_inwait);
1128 cv_destroy(&tp->t_outwait);
1129 cv_destroy(&tp->t_bgwait);
1130 cv_destroy(&tp->t_dcdwait);
1131 cv_destroy(&tp->t_outserwait);
1132
1133 if (tp->t_mtx == &tp->t_mtxobj)
1134 mtx_destroy(&tp->t_mtxobj);
1135 ttydevsw_free(tp);
1136 free(tp, M_TTY);
1137}
1138
1139static void
1140tty_rel_free(struct tty *tp)

Callers

nothing calls this directly

Calls 7

ttyinq_freeFunction · 0.85
ttyoutq_freeFunction · 0.85
seldrainFunction · 0.85
knlist_destroyFunction · 0.85
ttydevsw_freeFunction · 0.85
cv_destroyFunction · 0.70
freeFunction · 0.70

Tested by

no test coverage detected