fix race condition that can trigger 'enqueue already ready process' panic.
This commit is contained in:
parent
567f2f0ba0
commit
a74132ec69
1 changed files with 6 additions and 2 deletions
|
@ -107,8 +107,12 @@ message *m_ptr; /* pointer to request message */
|
||||||
*/
|
*/
|
||||||
if (prev_ptr->p_ticks_left <= 0 && priv(prev_ptr)->s_flags & PREEMPTIBLE) {
|
if (prev_ptr->p_ticks_left <= 0 && priv(prev_ptr)->s_flags & PREEMPTIBLE) {
|
||||||
if(prev_ptr->p_rts_flags == 0) { /* if it was runnable .. */
|
if(prev_ptr->p_rts_flags == 0) { /* if it was runnable .. */
|
||||||
lock_dequeue(prev_ptr); /* take it off the queues */
|
lock;
|
||||||
lock_enqueue(prev_ptr); /* and reinsert it again */
|
{
|
||||||
|
dequeue(prev_ptr); /* take it off the queues */
|
||||||
|
enqueue(prev_ptr); /* and reinsert it again */
|
||||||
|
}
|
||||||
|
unlock;
|
||||||
} else {
|
} else {
|
||||||
kprintf("CLOCK: %d not runnable; flags: %x\n",
|
kprintf("CLOCK: %d not runnable; flags: %x\n",
|
||||||
prev_ptr->p_endpoint, prev_ptr->p_rts_flags);
|
prev_ptr->p_endpoint, prev_ptr->p_rts_flags);
|
||||||
|
|
Loading…
Reference in a new issue