* Early initialization of sleep queues that is called from the sleepinit() * SYSINIT. */
| 216 | * SYSINIT. |
| 217 | */ |
| 218 | void |
| 219 | init_sleepqueues(void) |
| 220 | { |
| 221 | int i; |
| 222 | |
| 223 | for (i = 0; i < SC_TABLESIZE; i++) { |
| 224 | LIST_INIT(&sleepq_chains[i].sc_queues); |
| 225 | mtx_init(&sleepq_chains[i].sc_lock, "sleepq chain", NULL, |
| 226 | MTX_SPIN); |
| 227 | } |
| 228 | sleepq_zone = uma_zcreate("SLEEPQUEUE", sizeof(struct sleepqueue), |
| 229 | #ifdef INVARIANTS |
| 230 | NULL, sleepq_dtor, sleepq_init, NULL, UMA_ALIGN_CACHE, 0); |
| 231 | #else |
| 232 | NULL, NULL, sleepq_init, NULL, UMA_ALIGN_CACHE, 0); |
| 233 | #endif |
| 234 | |
| 235 | thread0.td_sleepqueue = sleepq_alloc(); |
| 236 | } |
| 237 | |
| 238 | /* |
| 239 | * Get a sleep queue for a new thread. |
no test coverage detected