| 1884 | } |
| 1885 | |
| 1886 | static void |
| 1887 | seltdinit(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 | |
| 1905 | static int |
| 1906 | seltdwait(struct thread *td, sbintime_t sbt, sbintime_t precision) |