summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpaul <paul>2005-04-25 14:53:46 +0000
committerpaul <paul>2005-04-25 14:53:46 +0000
commit907873a076a62a51cd5f832b9853274e2ecd0eee (patch)
treecf3ea7afe998d0da60a452c37a1b1b39f82edce5 /lib
parentc4d23bba6d522336755676a028a8f4355500ab67 (diff)
2005-04-25 Paul Jakma <paul.jakma@sun.com>
* thread.c: Kill unused TIMER_NO_SORT bits
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog1
-rw-r--r--lib/thread.c48
2 files changed, 1 insertions, 48 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 61b37642..7d9d83de 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 33331242..96ec50d0 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -501,9 +501,7 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
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 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
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 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
thread_list_add_before (list, tt, thread);
else
thread_list_add (list, thread);
-#endif /* TIMER_NO_SORT */
return thread;
}
@@ -686,47 +680,6 @@ thread_cancel_event (struct thread_master *m, void *arg)
}
}
-#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 @@ thread_timer_wait (struct thread_list *tlist, struct timeval *timer_val)
}
return NULL;
}
-#endif /* TIMER_NO_SORT */
struct thread *
thread_run (struct thread_master *m, struct thread *thread,