From efb0f66b66821d5155d7c1b0232427c4b5af2c73 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 10 Dec 2004 21:57:06 +0000 Subject: [PATCH] revert-mwaitprocs-20041210 FIXES 5616 revert this for now --- src/lwp/lwp.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/lwp/lwp.c b/src/lwp/lwp.c index 06e3e1b49e..1a9a4f0258 100644 --- a/src/lwp/lwp.c +++ b/src/lwp/lwp.c @@ -121,7 +121,7 @@ static purge_dead_pcbs(); struct QUEUE { PROCESS head; int count; -} runnable[MAX_PRIORITIES], blocked, qwaiting; +} runnable[MAX_PRIORITIES], blocked; /* Invariant for runnable queues: The head of each queue points to the currently running process if it is in that queue, or it points to the next process in that queue that should run. */ /* Offset of stack field within pcb -- used by stack checking stuff */ @@ -242,7 +242,7 @@ LWP_QWait(void) { register PROCESS tp; (tp = lwp_cpptr)->status = QWAITING; - move(tp, &runnable[tp->priority], &qwaiting); + lwp_remove(tp, &runnable[tp->priority]); Set_LWP_RC(); return LWP_SUCCESS; } @@ -253,7 +253,7 @@ LWP_QSignal(pid) { if (pid->status == QWAITING) { pid->status = READY; - move(pid, &qwaiting, &runnable[pid->priority]); + insert(pid, &runnable[pid->priority]); return LWP_SUCCESS; } else return LWP_ENOWAIT; @@ -561,9 +561,6 @@ Dump_Processes(void) for_all_elts(x, blocked, { Dump_One_Process(x);} ) - for_all_elts(x, qwaiting, { - Dump_One_Process(x);} - ) } else printf("***LWP: LWP support not initialized\n"); return 0; @@ -604,8 +601,6 @@ LWP_InitializeProcessSupport(int priority, PROCESS * pid) } blocked.head = NULL; blocked.count = 0; - qwaiting.head = NULL; - qwaiting.count = 0; lwp_init = (struct lwp_ctl *)malloc(sizeof(struct lwp_ctl)); temp = (PROCESS) malloc(sizeof(struct lwp_pcb)); if (lwp_init == NULL || temp == NULL) @@ -664,9 +659,6 @@ LWP_TerminateProcessSupport(void) ) for_all_elts(cur, blocked, { Free_PCB(cur);} - ) - for_all_elts(cur, qwaiting, { - Free_PCB(cur);} ) free(lwp_init); lwp_init = NULL; @@ -792,9 +784,7 @@ Delete_PCB(register PROCESS pid) lwp_remove(pid, (pid->blockflag || pid->status == WAITING || pid->status == - DESTROYED ? &blocked : - (pid->status == QWAITING) ? &qwaiting : - &runnable[pid->priority])); + DESTROYED ? &blocked : &runnable[pid->priority])); LWPANCHOR.processcnt--; return 0; } @@ -821,9 +811,6 @@ Dump_One_Process(PROCESS pid) case DESTROYED: printf("DESTROYED"); break; - case QWAITING: - printf("QWAITING"); - break; default: printf("unknown"); } @@ -883,13 +870,7 @@ Dispatcher(void) printf(" \"%s\"", p->name); } ) - puts("]"); - printf("[Qwaiting (%d):", qwaiting.count); - for_all_elts(p, qwaiting, { - printf(" \"%s\"", p->name); - } - ) - puts("]"); + puts("]"); } #endif