# This makes the MemorySegmentBuilder exit its main loop. It
# should make the builder thread joinable.
with self._builder_cv:
- self._builder_command_queue.append('shutdown')
+ self._builder_command_queue.append(('shutdown',))
self._builder_cv.notify_all()
self._builder_thread.join()
# Run commands passed in the command queue sequentially
# in the given order. For now, it only supports the
# "shutdown" command, which just exits the thread.
- for command in local_command_queue:
+ for command_tuple in local_command_queue:
+ command = command_tuple[0]
if command == 'shutdown':
self.__handle_shutdown()
# When the shutdown command is received, we do
# Now that the builder thread is running, send it a bad
# command. The thread should exit its main loop and be joinable.
with self._builder_cv:
- self._builder_command_queue.append('bad_command')
+ self._builder_command_queue.append(('bad_command',))
self._builder_cv.notify_all()
# Wait 5 seconds to receive a notification on the socket from
# Now that the builder thread is running, send it the shutdown
# command. The thread should exit its main loop and be joinable.
with self._builder_cv:
- self._builder_command_queue.append('shutdown')
+ self._builder_command_queue.append(('shutdown',))
# Commands after 'shutdown' must be ignored.
- self._builder_command_queue.append('bad_command_1')
- self._builder_command_queue.append('bad_command_2')
+ self._builder_command_queue.append(('bad_command_1',))
+ self._builder_command_queue.append(('bad_command_2',))
self._builder_cv.notify_all()
# Wait 5 seconds at most for the main loop of the builder to