зеркало из https://github.com/mozilla/gecko-dev.git
Suspended local threads should be moved to the suspend queue after I/O
completion or timeout.
This commit is contained in:
Родитель
4a32a3822e
Коммит
189e007e02
|
@ -1362,6 +1362,17 @@ static void FindBadFDs(void)
|
|||
_PR_DEL_SLEEPQ(pq->thr, PR_TRUE);
|
||||
_PR_SLEEPQ_UNLOCK(pq->thr->cpu);
|
||||
|
||||
if (pq->thr->flags & _PR_SUSPENDING) {
|
||||
/*
|
||||
* set thread state to SUSPENDED;
|
||||
* a Resume operation on the thread
|
||||
* will move it to the runQ
|
||||
*/
|
||||
pq->thr->state = _PR_SUSPENDED;
|
||||
_PR_MISCQ_LOCK(pq->thr->cpu);
|
||||
_PR_ADD_SUSPENDQ(pq->thr, pq->thr->cpu);
|
||||
_PR_MISCQ_UNLOCK(pq->thr->cpu);
|
||||
} else {
|
||||
pri = pq->thr->priority;
|
||||
pq->thr->state = _PR_RUNNABLE;
|
||||
|
||||
|
@ -1369,6 +1380,7 @@ static void FindBadFDs(void)
|
|||
_PR_ADD_RUNQ(pq->thr, cpu, pri);
|
||||
_PR_RUNQ_UNLOCK(cpu);
|
||||
}
|
||||
}
|
||||
_PR_THREAD_UNLOCK(pq->thr);
|
||||
} else {
|
||||
if (pq->timeout < _PR_IOQ_TIMEOUT(me->cpu))
|
||||
|
@ -1695,6 +1707,17 @@ extern sigset_t ints_off;
|
|||
_PR_DEL_SLEEPQ(pq->thr, PR_TRUE);
|
||||
_PR_SLEEPQ_UNLOCK(pq->thr->cpu);
|
||||
|
||||
if (pq->thr->flags & _PR_SUSPENDING) {
|
||||
/*
|
||||
* set thread state to SUSPENDED;
|
||||
* a Resume operation on the thread
|
||||
* will move it to the runQ
|
||||
*/
|
||||
pq->thr->state = _PR_SUSPENDED;
|
||||
_PR_MISCQ_LOCK(pq->thr->cpu);
|
||||
_PR_ADD_SUSPENDQ(pq->thr, pq->thr->cpu);
|
||||
_PR_MISCQ_UNLOCK(pq->thr->cpu);
|
||||
} else {
|
||||
pri = pq->thr->priority;
|
||||
pq->thr->state = _PR_RUNNABLE;
|
||||
|
||||
|
@ -1704,6 +1727,7 @@ extern sigset_t ints_off;
|
|||
if (_pr_md_idle_cpus > 1)
|
||||
_PR_MD_WAKEUP_WAITER(thred);
|
||||
}
|
||||
}
|
||||
_PR_THREAD_UNLOCK(thred);
|
||||
_PR_IOQ_OSFD_CNT(me->cpu) -= pq->npds;
|
||||
PR_ASSERT(_PR_IOQ_OSFD_CNT(me->cpu) >= 0);
|
||||
|
@ -1792,6 +1816,17 @@ extern sigset_t ints_off;
|
|||
_PR_DEL_SLEEPQ(pq->thr, PR_TRUE);
|
||||
_PR_SLEEPQ_UNLOCK(pq->thr->cpu);
|
||||
|
||||
if (pq->thr->flags & _PR_SUSPENDING) {
|
||||
/*
|
||||
* set thread state to SUSPENDED;
|
||||
* a Resume operation on the thread
|
||||
* will move it to the runQ
|
||||
*/
|
||||
pq->thr->state = _PR_SUSPENDED;
|
||||
_PR_MISCQ_LOCK(pq->thr->cpu);
|
||||
_PR_ADD_SUSPENDQ(pq->thr, pq->thr->cpu);
|
||||
_PR_MISCQ_UNLOCK(pq->thr->cpu);
|
||||
} else {
|
||||
pri = pq->thr->priority;
|
||||
pq->thr->state = _PR_RUNNABLE;
|
||||
|
||||
|
@ -1802,6 +1837,7 @@ extern sigset_t ints_off;
|
|||
if (_pr_md_idle_cpus > 1)
|
||||
_PR_MD_WAKEUP_WAITER(thred);
|
||||
}
|
||||
}
|
||||
_PR_THREAD_UNLOCK(thred);
|
||||
} else {
|
||||
if (pq->timeout < _PR_IOQ_TIMEOUT(me->cpu))
|
||||
|
|
Загрузка…
Ссылка в новой задаче