From 187f5d180cfd89edc38fa0e7df484e811dbd96c3 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 5 Jul 2017 16:51:25 -0400 Subject: [PATCH] possible race condition --- op25/gr-op25_repeater/apps/rx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/op25/gr-op25_repeater/apps/rx.py b/op25/gr-op25_repeater/apps/rx.py index fa97a2c..4adb19b 100755 --- a/op25/gr-op25_repeater/apps/rx.py +++ b/op25/gr-op25_repeater/apps/rx.py @@ -82,6 +82,9 @@ class p25_rx_block (gr.top_block): # def __init__(self): + self.trunk_rx = None + self.kill_sink = None + gr.top_block.__init__(self) # command line argument parsing @@ -278,7 +281,6 @@ class p25_rx_block (gr.top_block): # connect it all up self.connect(source, self.demod, self.decoder) - self.kill_sink = None if self.options.plot_mode == 'constellation': assert self.options.demod_type == 'cqpsk' ## constellation requires cqpsk demod-type self.constellation_sink = constellation_sink_c() @@ -598,6 +600,8 @@ class p25_rx_block (gr.top_block): s = msg.to_string() if s == 'quit': return True elif s == 'update': + if self.trunk_rx is None: + return False ## possible race cond - just ignore js = self.trunk_rx.to_json() msg = gr.message().make_from_string(js, -4, 0, 0) self.input_q.insert_tail(msg)