Lines Matching defs:stp

1398 	struct seltd *stp;
1408 stp = td->td_sel;
1411 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) {
1414 selfdfree(stp, sfp);
1434 stp->st_flags = 0;
1661 struct seltd *stp;
1673 stp = td->td_sel;
1675 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) {
1678 selfdfree(stp, sfp);
1703 stp->st_flags = 0;
1842 struct seltd *stp;
1844 stp = td->td_sel;
1845 if (stp->st_free1 == NULL)
1846 stp->st_free1 = malloc(sizeof(*stp->st_free1), M_SELFD, M_WAITOK|M_ZERO);
1847 stp->st_free1->sf_td = stp;
1848 stp->st_free1->sf_cookie = cookie;
1849 if (stp->st_free2 == NULL)
1850 stp->st_free2 = malloc(sizeof(*stp->st_free2), M_SELFD, M_WAITOK|M_ZERO);
1851 stp->st_free2->sf_td = stp;
1852 stp->st_free2->sf_cookie = cookie;
1856 selfdfree(struct seltd *stp, struct selfd *sfp)
1858 STAILQ_REMOVE(&stp->st_selq, sfp, selfd, sf_link);
1895 struct seltd *stp;
1898 stp = selector->td_sel;
1902 if (stp->st_flags & SELTD_RESCAN)
1908 if ((sfp = stp->st_free1) != NULL)
1909 stp->st_free1 = NULL;
1910 else if ((sfp = stp->st_free2) != NULL)
1911 stp->st_free2 = NULL;
1922 STAILQ_INSERT_TAIL(&stp->st_selq, sfp, sf_link);
1960 struct seltd *stp;
1975 stp = sfp->sf_td;
1976 mtx_lock(&stp->st_mtx);
1977 stp->st_flags |= SELTD_PENDING;
1978 cv_broadcastpri(&stp->st_wait, pri);
1979 mtx_unlock(&stp->st_mtx);
1984 * stp is not used after selfdfree returns.
1994 struct seltd *stp;
1996 stp = td->td_sel;
1997 if (stp != NULL) {
1998 MPASS(stp->st_flags == 0);
1999 MPASS(STAILQ_EMPTY(&stp->st_selq));
2002 stp = malloc(sizeof(*stp), M_SELECT, M_WAITOK|M_ZERO);
2003 mtx_init(&stp->st_mtx, "sellck", NULL, MTX_DEF);
2004 cv_init(&stp->st_wait, "select");
2005 stp->st_flags = 0;
2006 STAILQ_INIT(&stp->st_selq);
2007 td->td_sel = stp;
2013 struct seltd *stp;
2016 stp = td->td_sel;
2021 mtx_lock(&stp->st_mtx);
2025 stp->st_flags |= SELTD_RESCAN;
2026 if (stp->st_flags & SELTD_PENDING) {
2027 mtx_unlock(&stp->st_mtx);
2033 error = cv_timedwait_sig_sbt(&stp->st_wait, &stp->st_mtx,
2036 error = cv_wait_sig(&stp->st_wait, &stp->st_mtx);
2037 mtx_unlock(&stp->st_mtx);
2045 struct seltd *stp;
2047 stp = td->td_sel;
2048 if (stp == NULL)
2050 MPASS(stp->st_flags == 0);
2051 MPASS(STAILQ_EMPTY(&stp->st_selq));
2052 if (stp->st_free1)
2053 free(stp->st_free1, M_SELFD);
2054 if (stp->st_free2)
2055 free(stp->st_free2, M_SELFD);
2057 cv_destroy(&stp->st_wait);
2058 mtx_destroy(&stp->st_mtx);
2059 free(stp, M_SELECT);
2069 struct seltd *stp;
2073 stp = td->td_sel;
2074 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn)
2075 selfdfree(stp, sfp);
2076 stp->st_flags = 0;