mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 05:37:55 +00:00
Move the loop that waits for scheduled threads to finish out of advance_sim_time #292
Forgot to introduce the new function.
This commit is contained in:
parent
f5578c2e79
commit
aeeaa7b3bc
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "trick/Executive.hh"
|
||||||
|
#include "trick/release.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@design
|
||||||
|
-# Loop through all threads.
|
||||||
|
-# Wait for thread to finish if the thread is PROCESS_TYPE_SCHEDULED
|
||||||
|
*/
|
||||||
|
int Trick::Executive::scheduled_thread_sync() {
|
||||||
|
|
||||||
|
unsigned int ii ;
|
||||||
|
|
||||||
|
/* 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) {
|
||||||
|
while (curr_thread->child_complete == false ) {
|
||||||
|
if (rt_nap == true) {
|
||||||
|
RELEASE();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user