Clean up mthread

This commit is contained in:
Thomas Veerman
2011-07-27 09:30:26 +00:00
parent b67a7fca8c
commit 9b43de2cb3
10 changed files with 111 additions and 132 deletions

View File

@@ -54,6 +54,7 @@ mthread_queue_t *queue;
/*===========================================================================*
* mthread_dump_queue *
*===========================================================================*/
#ifdef MDEBUG
PUBLIC void mthread_dump_queue(queue)
mthread_queue_t *queue;
{
@@ -61,39 +62,30 @@ mthread_queue_t *queue;
mthread_tcb_t *t;
mthread_thread_t tid;
threshold = no_threads;
#ifdef MDEBUG
printf("Dumping queue: ");
#endif
if(queue->mq_head != NULL) {
t = queue->mq_head;
if (t == &mainthread) tid = MAIN_THREAD;
else tid = t->m_tid;
#ifdef MDEBUG
printf("%d ", tid);
#endif
count++;
t = t->m_next;
while (t != NULL) {
if (t == &mainthread) tid = MAIN_THREAD;
else tid = t->m_tid;
#ifdef MDEBUG
printf("%d ", tid);
#endif
t = t->m_next;
count++;
if (count > threshold) break;
}
} else {
#ifdef MDEBUG
printf("[empty]");
#endif
}
#ifdef MDEBUG
printf("\n");
#endif
}
#endif
/*===========================================================================*
* mthread_queue_remove *