1
0
mirror of https://github.com/simh/simh.git synced 2026-04-17 00:36:00 +00:00

TIMER: Changed sim_idle_ms_sleep() to use a mutex which is unique to idling

It seems that the prior use of sim_asynch_lock RECURSIVE mutex could
cause a pthread_cond_timedwait() failure with EINVAL returned.
As discussed in #595
This commit is contained in:
Mark Pizzolato
2018-07-11 11:59:05 -07:00
parent 29a4fb9802
commit 484889ea5a
3 changed files with 7 additions and 3 deletions

View File

@@ -1062,6 +1062,7 @@ struct MEMFILE {
extern pthread_mutex_t sim_asynch_lock;
extern pthread_cond_t sim_asynch_wake;
extern pthread_mutex_t sim_idle_lock;
extern pthread_mutex_t sim_timer_lock;
extern pthread_cond_t sim_timer_wake;
extern t_bool sim_timer_event_canceled;
@@ -1174,6 +1175,7 @@ extern int32 sim_asynch_inst_latency;
do { \
pthread_mutex_destroy(&sim_asynch_lock); \
pthread_cond_destroy(&sim_asynch_wake); \
pthread_mutex_destroy(&sim_idle_lock); \
pthread_mutex_destroy(&sim_timer_lock); \
pthread_cond_destroy(&sim_timer_wake); \
pthread_mutex_destroy(&sim_tmxr_poll_lock); \
@@ -1223,6 +1225,7 @@ extern int32 sim_asynch_inst_latency;
do { \
pthread_mutex_destroy(&sim_asynch_lock); \
pthread_cond_destroy(&sim_asynch_wake); \
pthread_mutex_destroy(&sim_idle_lock); \
pthread_mutex_destroy(&sim_timer_lock); \
pthread_cond_destroy(&sim_timer_wake); \
pthread_mutex_destroy(&sim_tmxr_poll_lock); \