2005-04-25 Paul Jakma <paul.jakma@sun.com>
* thread.c: Kill unused TIMER_NO_SORT bits
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 61b3764..7d9d83d 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -4,6 +4,7 @@
out-of-tree build breakage.
* memory.c: Make the string field much wider
* memtypes.c: Correct the prefix list str/entry strings
+ * thread.c: Kill unused TIMER_NO_SORT bits
2005-04-22 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
diff --git a/lib/thread.c b/lib/thread.c
index 3333124..96ec50d 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -501,9 +501,7 @@
struct thread *thread;
struct timeval timer_now;
struct thread_list *list;
-#ifndef TIMER_NO_SORT
struct thread *tt;
-#endif /* TIMER_NO_SORT */
assert (m != NULL);
@@ -532,9 +530,6 @@
thread->u.sands = timer_now;
/* Sort by timeval. */
-#ifdef TIMER_NO_SORT
- thread_list_add (list, thread);
-#else
for (tt = list->head; tt; tt = tt->next)
if (timeval_cmp (thread->u.sands, tt->u.sands) <= 0)
break;
@@ -543,7 +538,6 @@
thread_list_add_before (list, tt, thread);
else
thread_list_add (list, thread);
-#endif /* TIMER_NO_SORT */
return thread;
}
@@ -686,47 +680,6 @@
}
}
-#ifdef TIMER_NO_SORT
-static struct timeval *
-thread_timer_wait (struct thread_list *tlist, struct timeval *timer_val)
-{
- struct timeval timer_now;
- struct timeval timer_min;
- struct timeval *timer_wait;
-
- gettimeofday (&timer_now, NULL);
-
- timer_wait = NULL;
- for (thread = tlist->head; thread; thread = thread->next)
- {
- if (! timer_wait)
- timer_wait = &thread->u.sands;
- else if (timeval_cmp (thread->u.sands, *timer_wait) < 0)
- timer_wait = &thread->u.sands;
- }
-
- if (tlist->head)
- {
- timer_min = *timer_wait;
- timer_min = timeval_subtract (timer_min, timer_now);
- if (timer_min.tv_sec < 0)
- {
- timer_min.tv_sec = 0;
- timer_min.tv_usec = 10;
- }
- timer_wait = &timer_min;
- }
- else
- timer_wait = NULL;
-
- if (timer_wait)
- {
- *timer_val = timer_wait;
- return timer_val;
- }
- return NULL;
-}
-#else /* ! TIMER_NO_SORT */
static struct timeval *
thread_timer_wait (struct thread_list *tlist, struct timeval *timer_val)
{
@@ -748,7 +701,6 @@
}
return NULL;
}
-#endif /* TIMER_NO_SORT */
struct thread *
thread_run (struct thread_master *m, struct thread *thread,