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

Function seltdinit

freebsd/kern/sys_generic.c:1886–1903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1884}
1885
1886static void
1887seltdinit(struct thread *td)
1888{
1889 struct seltd *stp;
1890
1891 stp = td->td_sel;
1892 if (stp != NULL) {
1893 MPASS(stp->st_flags == 0);
1894 MPASS(STAILQ_EMPTY(&stp->st_selq));
1895 return;
1896 }
1897 stp = malloc(sizeof(*stp), M_SELECT, M_WAITOK|M_ZERO);
1898 mtx_init(&stp->st_mtx, "sellck", NULL, MTX_DEF);
1899 cv_init(&stp->st_wait, "select");
1900 stp->st_flags = 0;
1901 STAILQ_INIT(&stp->st_selq);
1902 td->td_sel = stp;
1903}
1904
1905static int
1906seltdwait(struct thread *td, sbintime_t sbt, sbintime_t precision)

Callers 3

kern_selectFunction · 0.85
kern_pollFunction · 0.85
selsocketFunction · 0.85

Calls 3

mallocFunction · 0.85
mtx_initFunction · 0.85
cv_initFunction · 0.70

Tested by

no test coverage detected