Print this page
10098 task_alloc() in libfakekernel gets KM_NOSLEEP test wrong
*** 98,108 ****
again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
tq->tq_freelist = t->tqent_next;
} else {
if (tq->tq_nalloc >= tq->tq_maxalloc) {
! if (!(tqflags & KM_SLEEP))
return (NULL);
/*
* We don't want to exceed tq_maxalloc, but we can't
* wait for other tasks to complete (and thus free up
--- 98,108 ----
again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
tq->tq_freelist = t->tqent_next;
} else {
if (tq->tq_nalloc >= tq->tq_maxalloc) {
! if (tqflags & KM_NOSLEEP)
return (NULL);
/*
* We don't want to exceed tq_maxalloc, but we can't
* wait for other tasks to complete (and thus free up