The main routine for a thread's work.

    The thread pulls tasks from the manager's task queue and executes
    them until it encounters a task with a function that is None.

def run(self):
    """The main routine for a thread's work.

    The thread pulls tasks from the manager's task queue and executes
    them until it encounters a task with a function that is None.
    """
    try:
      while True:
        aFunction, arguments = self.manager.taskQueue.get()
        if aFunction is None:
          break
        aFunction(arguments)
    except KeyboardInterrupt:
      import thread
      print >>sys.stderr, "%s caught KeyboardInterrupt" % threading.currentThread().getName()
      thread.interrupt_main()
    except Exception, x:
      print >>sys.stderr, "Something BAD happened in %s:" % threading.currentThread().getName()
      traceback.print_exc(file=sys.stderr)
      print >>sys.stderr, x