##// END OF EJS Templates
Thread safety fix in KernelManager:...
epatters -
Show More
@@ -166,15 +166,15 b' class XReqSocketChannel(ZmqSocketChannel):'
166 166 command_queue = None
167 167
168 168 def __init__(self, context, session, address):
169 self.command_queue = Queue()
170 169 super(XReqSocketChannel, self).__init__(context, session, address)
170 self.command_queue = Queue()
171 self.ioloop = ioloop.IOLoop()
171 172
172 173 def run(self):
173 174 """The thread's main activity. Call start() instead."""
174 175 self.socket = self.context.socket(zmq.XREQ)
175 176 self.socket.setsockopt(zmq.IDENTITY, self.session.session)
176 177 self.socket.connect('tcp://%s:%i' % self.address)
177 self.ioloop = ioloop.IOLoop()
178 178 self.iostate = POLLERR|POLLIN
179 179 self.ioloop.add_handler(self.socket, self._handle_events,
180 180 self.iostate)
@@ -359,6 +359,7 b' class SubSocketChannel(ZmqSocketChannel):'
359 359
360 360 def __init__(self, context, session, address):
361 361 super(SubSocketChannel, self).__init__(context, session, address)
362 self.ioloop = ioloop.IOLoop()
362 363
363 364 def run(self):
364 365 """The thread's main activity. Call start() instead."""
@@ -366,7 +367,6 b' class SubSocketChannel(ZmqSocketChannel):'
366 367 self.socket.setsockopt(zmq.SUBSCRIBE,'')
367 368 self.socket.setsockopt(zmq.IDENTITY, self.session.session)
368 369 self.socket.connect('tcp://%s:%i' % self.address)
369 self.ioloop = ioloop.IOLoop()
370 370 self.iostate = POLLIN|POLLERR
371 371 self.ioloop.add_handler(self.socket, self._handle_events,
372 372 self.iostate)
@@ -444,15 +444,15 b' class RepSocketChannel(ZmqSocketChannel):'
444 444 msg_queue = None
445 445
446 446 def __init__(self, context, session, address):
447 self.msg_queue = Queue()
448 447 super(RepSocketChannel, self).__init__(context, session, address)
448 self.ioloop = ioloop.IOLoop()
449 self.msg_queue = Queue()
449 450
450 451 def run(self):
451 452 """The thread's main activity. Call start() instead."""
452 453 self.socket = self.context.socket(zmq.XREQ)
453 454 self.socket.setsockopt(zmq.IDENTITY, self.session.session)
454 455 self.socket.connect('tcp://%s:%i' % self.address)
455 self.ioloop = ioloop.IOLoop()
456 456 self.iostate = POLLERR|POLLIN
457 457 self.ioloop.add_handler(self.socket, self._handle_events,
458 458 self.iostate)
General Comments 0
You need to be logged in to leave comments. Login now