diff --git a/trick_source/sim_services/Executive/Executive_advance_sim_time.cpp b/trick_source/sim_services/Executive/Executive_advance_sim_time.cpp index 30961b27..8d3b9574 100644 --- a/trick_source/sim_services/Executive/Executive_advance_sim_time.cpp +++ b/trick_source/sim_services/Executive/Executive_advance_sim_time.cpp @@ -42,14 +42,16 @@ int Trick::Executive::advance_sim_time() { /* Adjust time_tics if one of the threads has a job or async cycle time less than the main thread's next job */ for (ii = 1; ii < threads.size() ; ii++) { Threads * curr_thread = threads[ii] ; - if ( (curr_thread->process_type == PROCESS_TYPE_SCHEDULED) && - (curr_thread->job_queue.get_next_job_call_time() < time_tics) ) { - time_tics = curr_thread->job_queue.get_next_job_call_time() ; - } - if ( (curr_thread->process_type == PROCESS_TYPE_AMF_CHILD ) && - (curr_thread->amf_cycle_tics > 0 ) && - (curr_thread->amf_next_tics < time_tics) ) { - time_tics = curr_thread->amf_next_tics ; + if ( curr_thread->enabled ) { + if ( (curr_thread->process_type == PROCESS_TYPE_SCHEDULED) && + (curr_thread->job_queue.get_next_job_call_time() < time_tics) ) { + time_tics = curr_thread->job_queue.get_next_job_call_time() ; + } + if ( (curr_thread->process_type == PROCESS_TYPE_AMF_CHILD ) && + (curr_thread->amf_cycle_tics > 0 ) && + (curr_thread->amf_next_tics < time_tics) ) { + time_tics = curr_thread->amf_next_tics ; + } } } diff --git a/trick_source/sim_services/Executive/Executive_isThreadReadyToRun.cpp b/trick_source/sim_services/Executive/Executive_isThreadReadyToRun.cpp index 5db8bfdb..043fbafa 100644 --- a/trick_source/sim_services/Executive/Executive_isThreadReadyToRun.cpp +++ b/trick_source/sim_services/Executive/Executive_isThreadReadyToRun.cpp @@ -10,26 +10,28 @@ */ bool Trick::Executive::isThreadReadyToRun( Trick::Threads * curr_thread , long long time_ticks) { bool ret = false ; - switch ( curr_thread->process_type ) { - case Trick::PROCESS_TYPE_SCHEDULED: - ret = true ; - break ; - case Trick::PROCESS_TYPE_AMF_CHILD: - if ( curr_thread->amf_next_tics == time_ticks ) { + if ( curr_thread->enabled ) { + switch ( curr_thread->process_type ) { + case Trick::PROCESS_TYPE_SCHEDULED: ret = true ; - } - break ; - case Trick::PROCESS_TYPE_ASYNC_CHILD: - if ( curr_thread->child_complete == true ) { - if (curr_thread->amf_cycle_tics == 0 ) { + break ; + case Trick::PROCESS_TYPE_AMF_CHILD: + if ( curr_thread->amf_next_tics == time_ticks ) { ret = true ; - } else { - if ( curr_thread->amf_next_tics == time_ticks ) { + } + break ; + case Trick::PROCESS_TYPE_ASYNC_CHILD: + if ( curr_thread->child_complete == true ) { + if (curr_thread->amf_cycle_tics == 0 ) { ret = true ; + } else { + if ( curr_thread->amf_next_tics == time_ticks ) { + ret = true ; + } } } - } - break ; + break ; + } } return ret ; } diff --git a/trick_source/sim_services/Executive/Executive_scheduled_thread_sync.cpp b/trick_source/sim_services/Executive/Executive_scheduled_thread_sync.cpp index e3044d08..59f631e2 100644 --- a/trick_source/sim_services/Executive/Executive_scheduled_thread_sync.cpp +++ b/trick_source/sim_services/Executive/Executive_scheduled_thread_sync.cpp @@ -16,7 +16,7 @@ int Trick::Executive::scheduled_thread_sync() { /* Wait for synchronous threads to finish before testing for adjusting time_tics */ for (ii = 1; ii < threads.size() ; ii++) { Threads * curr_thread = threads[ii] ; - if ( curr_thread->process_type == PROCESS_TYPE_SCHEDULED) { + if ( curr_thread->enabled and curr_thread->process_type == PROCESS_TYPE_SCHEDULED) { while (curr_thread->child_complete == false ) { if (rt_nap == true) { RELEASE();