diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-11-27 21:58:42 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-11-27 21:58:42 +0000 |
commit | 66c38dfb1b5cbadb1a1c8813be5d8449fa21eb3c (patch) | |
tree | 1ce486b149fb451262a498d138a6faa62c88094c /pfinet | |
parent | fd8f5647db320fb30d87e155c4a84cafb633ea27 (diff) |
Formerly timer-emul.c.~8~
Diffstat (limited to 'pfinet')
-rw-r--r-- | pfinet/timer-emul.c | 17 |
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)); } |