summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-11-27 21:58:42 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-11-27 21:58:42 +0000
commit66c38dfb1b5cbadb1a1c8813be5d8449fa21eb3c (patch)
tree1ce486b149fb451262a498d138a6faa62c88094c
parentfd8f5647db320fb30d87e155c4a84cafb633ea27 (diff)
Formerly timer-emul.c.~8~
-rw-r--r--pfinet/timer-emul.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/pfinet/timer-emul.c b/pfinet/timer-emul.c
index af1469ef..90d38b46 100644
--- a/pfinet/timer-emul.c
+++ b/pfinet/timer-emul.c
@@ -67,8 +67,8 @@ timer_function (int this_is_a_pointless_variable_with_a_rather_long_name)
tp = timers;
timers = timers->next;
- if (timers->next)
- timers->next->prevp = &timers;
+ if (timers)
+ timers->prevp = &timers;
tp->next = 0;
tp->prevp = 0;
@@ -108,10 +108,13 @@ add_timer (struct timer_list *timer)
to push things up. */
while (timer_thread == 0)
swtch_pri (0);
-
- thread_suspend (timer_thread);
- thread_abort (timer_thread);
- thread_resume (timer_thread);
+
+ if (timer_thread != mach_thread_self ())
+ {
+ thread_suspend (timer_thread);
+ thread_abort (timer_thread);
+ thread_resume (timer_thread);
+ }
}
}
@@ -157,7 +160,7 @@ init_time ()
fill_timeval (&tp);
root_jiffies = (long long) tp.tv_sec * HZ
- + (long long) tp.tv_usec * HZ / 1000.0;
+ + ((long long) tp.tv_usec * HZ) / 1000;
cthread_detach (cthread_fork ((cthread_fn_t) timer_function, 0));
}