1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

TIMER: Fix various inconsistent timing behaviors

- Support for arbitrary long wait intervals in sim_activate_after with
   precisely correct delays aligned with the calibrated clock once
   per second.
- Proper handling of calls to sim_cancel for calibrated timer units
- Properly allow stopping of calibrated clock by calling sim_rtcn_calb
   with a ticksper == 0
- Only schedule asynchronous timer activities for delays longer than
   the minimal OS sleep time
- Only wake asynchronous timer thread to queue new timer events
   that are shorter than the currently shortest scheduled event
This commit is contained in:
Mark Pizzolato
2016-12-26 12:42:25 -08:00
parent 257738a4e0
commit aa82b57d10
4 changed files with 151 additions and 67 deletions

View File

@@ -134,8 +134,10 @@ void sim_stop_timer_services (void);
t_stat sim_timer_change_asynch (void);
t_stat sim_timer_activate (UNIT *uptr, int32 interval);
t_stat sim_timer_activate_after (UNIT *uptr, uint32 usec_delay);
t_stat sim_timer_activate_after_d (UNIT *uptr, double usec_delay);
int32 sim_timer_activate_time (UNIT *uptr);
t_bool sim_timer_is_active (UNIT *uptr);
t_bool sim_timer_cancel (UNIT *uptr);
t_stat sim_register_clock_unit (UNIT *uptr);
t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr);
t_stat sim_clock_coschedule (UNIT *uptr, int32 interval);