From 4fe2334b28f67d5009af4a2bc8f1c862c5598447 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 3 Jun 2013 09:17:17 -0400 Subject: [PATCH] Don't need locks for queue inserts --- python/zmq_socket.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/zmq_socket.py b/python/zmq_socket.py index deba0df..dcca93b 100644 --- a/python/zmq_socket.py +++ b/python/zmq_socket.py @@ -40,8 +40,6 @@ class zmq_pubsub_iface(threading.Thread): self._subaddr = subaddr self._pubaddr = pubaddr self._sub_connected = False - #self._pub_connected = False - self._publock = threading.Lock() self._pubsub = pubsub() if pubaddr is not None: self._pubsocket.bind(pubaddr) @@ -77,9 +75,8 @@ class zmq_pubsub_iface(threading.Thread): def __setitem__(self, key, val): if not self._pubaddr: raise Exception("No publisher address set") - with self._publock: - if not self.shutdown.is_set(): - self._queue.put([key, val.to_string()]) #TODO FIXME MSGQ + if not self.shutdown.is_set(): + self._queue.put([key, val.to_string()]) #TODO FIXME MSGQ def __getitem__(self, key): return self._pubsub[key]