* NOTE: Must be called with tq->tq_lock held, either destroys the * taskq_ent_t if too many exist or moves it to the free list for later use. */
| 188 | * taskq_ent_t if too many exist or moves it to the free list for later use. |
| 189 | */ |
| 190 | static void |
| 191 | task_done(taskq_t *tq, taskq_ent_t *t) |
| 192 | { |
| 193 | ASSERT(tq); |
| 194 | ASSERT(t); |
| 195 | |
| 196 | /* Wake tasks blocked in taskq_wait_id() */ |
| 197 | wake_up_all(&t->tqent_waitq); |
| 198 | |
| 199 | list_del_init(&t->tqent_list); |
| 200 | |
| 201 | if (tq->tq_nalloc <= tq->tq_minalloc) { |
| 202 | t->tqent_id = TASKQID_INVALID; |
| 203 | t->tqent_func = NULL; |
| 204 | t->tqent_arg = NULL; |
| 205 | t->tqent_flags = 0; |
| 206 | |
| 207 | list_add_tail(&t->tqent_list, &tq->tq_free_list); |
| 208 | } else { |
| 209 | task_free(tq, t); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * When a delayed task timer expires remove it from the delay list and |
no test coverage detected