mirror of
https://github.com/nasa/trick.git
synced 2025-01-23 21:08:02 +00:00
03d89ef56a
Created a thread trigger container class to hold all of the various thread triggering mechanisms. I wanted to avoid allocating/freeing trigger mechanisms. I added an eventfd and futex trigger types. Updated SIM_threads_simple test sim to use show how to set the thread trigger type. refs #148 Conflicts: trick_source/sim_services/Executive/include/Threads.hh trick_source/sim_services/Executive/src/Executive_set_thread_rt_semaphore.cpp trick_source/sim_services/Executive/src/Threads.cpp
20 lines
523 B
Python
20 lines
523 B
Python
import os
|
|
|
|
def main():
|
|
trick.real_time_enable()
|
|
trick.itimer_enable()
|
|
trick.exec_set_software_frame(0.10)
|
|
trick.stop(10)
|
|
|
|
trick.exec_set_thread_process_type(1, trick.PROCESS_TYPE_AMF_CHILD)
|
|
trick.exec_set_thread_amf_cycle_time(1, 0.5)
|
|
thr_con = trick.exec_get_thread(1).trigger_container
|
|
thr_con.setThreadTrigger(trick.TT_MUTEX)
|
|
|
|
trick.exec_set_thread_process_type(2, trick.PROCESS_TYPE_AMF_CHILD)
|
|
trick.exec_set_thread_amf_cycle_time(2, 0.1)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|