Skip to content

Commit

Permalink
Fix a synchronisation bug in PandA comms
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic Bricknell committed Apr 5, 2017
1 parent f5632ee commit e46cb81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions malcolm/parts/pandabox/pandaboxcontrol.py
Expand Up @@ -32,8 +32,7 @@ def __init__(self, process, hostname, port):

def send(self, message):
response_queue = self.process.create_queue()
self.response_queues.put(response_queue)
self.q.put(message)
self.q.put((message, response_queue))
return response_queue

def recv(self, response_queue, timeout=1.0):
Expand All @@ -60,11 +59,12 @@ def send_recv(self, message, timeout=1.0):
def send_loop(self):
"""Service self.q, sending requests to server"""
while True:
message = self.q.get()
message, response_queue = self.q.get()
if message is Spawnable.STOP:
break
try:
self.log_debug("Sending %r", message)
self.response_queues.put(response_queue)
self.socket.send(message)
except Exception: # pylint:disable=broad-except
self.log_exception(
Expand Down

0 comments on commit e46cb81

Please sign in to comment.