Lines Matching refs:stp

1257 	struct seltd *stp;
1266 stp = td->td_sel;
1268 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) {
1271 selfdfree(stp, sfp);
1285 stp->st_flags = 0;
1476 struct seltd *stp;
1490 stp = td->td_sel;
1492 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) {
1495 selfdfree(stp, sfp);
1522 stp->st_flags = 0;
1693 struct seltd *stp;
1695 stp = td->td_sel;
1696 if (stp->st_free1 == NULL)
1697 stp->st_free1 = uma_zalloc(selfd_zone, M_WAITOK|M_ZERO);
1698 stp->st_free1->sf_td = stp;
1699 stp->st_free1->sf_cookie = cookie;
1700 if (stp->st_free2 == NULL)
1701 stp->st_free2 = uma_zalloc(selfd_zone, M_WAITOK|M_ZERO);
1702 stp->st_free2->sf_td = stp;
1703 stp->st_free2->sf_cookie = cookie;
1707 selfdfree(struct seltd *stp, struct selfd *sfp)
1709 STAILQ_REMOVE(&stp->st_selq, sfp, selfd, sf_link);
1748 struct seltd *stp;
1751 stp = selector->td_sel;
1755 if (stp->st_flags & SELTD_RESCAN)
1761 if ((sfp = stp->st_free1) != NULL)
1762 stp->st_free1 = NULL;
1763 else if ((sfp = stp->st_free2) != NULL)
1764 stp->st_free2 = NULL;
1776 STAILQ_INSERT_TAIL(&stp->st_selq, sfp, sf_link);
1819 struct seltd *stp;
1835 stp = sfp->sf_td;
1836 mtx_lock(&stp->st_mtx);
1837 stp->st_flags |= SELTD_PENDING;
1838 cv_broadcastpri(&stp->st_wait, pri);
1839 mtx_unlock(&stp->st_mtx);
1849 struct seltd *stp;
1851 if ((stp = td->td_sel) != NULL)
1853 td->td_sel = stp = malloc(sizeof(*stp), M_SELECT, M_WAITOK|M_ZERO);
1854 mtx_init(&stp->st_mtx, "sellck", NULL, MTX_DEF);
1855 cv_init(&stp->st_wait, "select");
1857 stp->st_flags = 0;
1858 STAILQ_INIT(&stp->st_selq);
1864 struct seltd *stp;
1867 stp = td->td_sel;
1872 mtx_lock(&stp->st_mtx);
1876 stp->st_flags |= SELTD_RESCAN;
1877 if (stp->st_flags & SELTD_PENDING) {
1878 mtx_unlock(&stp->st_mtx);
1884 error = cv_timedwait_sig_sbt(&stp->st_wait, &stp->st_mtx,
1887 error = cv_wait_sig(&stp->st_wait, &stp->st_mtx);
1888 mtx_unlock(&stp->st_mtx);
1896 struct seltd *stp;
1898 stp = td->td_sel;
1899 if (stp == NULL)
1901 if (stp->st_free1)
1902 uma_zfree(selfd_zone, stp->st_free1);
1903 if (stp->st_free2)
1904 uma_zfree(selfd_zone, stp->st_free2);
1906 cv_destroy(&stp->st_wait);
1907 mtx_destroy(&stp->st_mtx);
1908 free(stp, M_SELECT);
1918 struct seltd *stp;
1922 stp = td->td_sel;
1923 STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn)
1924 selfdfree(stp, sfp);
1925 stp->st_flags = 0;