From 60b09907a308ca9e25e07127e93ebcaca639cdae Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Mon, 29 Aug 2016 10:11:05 -0500 Subject: [PATCH] Move the loop that waits for scheduled threads to finish out of advance_sim_time #292 Same error as in 17. When we moved the thread sync code, a loop to clear all job complete flags was left out causing unit test errors. --- .../sim_services/Executive/src/Executive_thread_sync.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trick_source/sim_services/Executive/src/Executive_thread_sync.cpp b/trick_source/sim_services/Executive/src/Executive_thread_sync.cpp index c08b1f13..778320db 100644 --- a/trick_source/sim_services/Executive/src/Executive_thread_sync.cpp +++ b/trick_source/sim_services/Executive/src/Executive_thread_sync.cpp @@ -53,6 +53,12 @@ int Trick::Executive::thread_sync() { } } + /* reset the job complete flags on thread 0 (master thread) */ + threads[0]->job_queue.reset_curr_index(); + while ( (curr_job = threads[0]->job_queue.find_job(time_tics)) != NULL ) { + curr_job->complete = false; + } + return(0) ; }