Commit 6a43155c authored by hazrmard's avatar hazrmard
Browse files

removed code for signal interrupt handling as it is not being used

parent 2e5e8d3d
......@@ -21,4 +21,5 @@ results*/
rl_results_local/
rl_perf_plot.py
modeltrainnb/
energyfreqanalysis/
\ No newline at end of file
energyfreqanalysis/
scratch/
\ No newline at end of file
......@@ -360,27 +360,6 @@ def learn_control(source: str, save_to: str, relearn_window: int, duration: int,
def signal_handler(signals, events, threads):
"""
Generates a function that sets provided events, and waits for provided threads
to join. Used by the `signal.signal(SIGNUM, HANDLER)` function.
"""
def handler(signum, _):
log.info('Got signal %d. Stopping.', signum)
for event in events:
event.set()
for thread in threads:
thread.join()
for sig in signals:
try:
log.info('Registering signal %d', sig)
signal.signal(sig, handler)
except Exception as e:
log.error('Could not register signal %d: %s', sig, str(e))
def demo_source(dest: str, signal_stop: Event, period: float, mean: np.ndarray,
sigma: np.ndarray):
"""
......@@ -484,14 +463,6 @@ if __name__ == '__main__':
})
th_ctrl.start()
# TODO: Handle interrupt signals besides Ctrl+C
# register interrupt signal handlers
# if sys.platform == 'win32':
# signals = (signal.SIGTERM, signal.SIGINT)
# else:
# signals = (signal.SIGTERM, signal.SIGBREAK, signal.SIGINT)
# signal_handler(signals, (signal_stop,), (th_ctrl,))
end = start = time.perf_counter()
while not signal_stop.is_set():
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment