def set_job_lock(self, command_handler, lock):
    "Set a worker level job lock so we don't try to hold onto 2 jobs at\n        anytime"
    if (command_handler not in self.handler_to_connection_map):
        return False
    failed_lock = bool((lock and (self.command_handler_holding_job_lock is not None)))
    failed_unlock = bool(((not lock) and (self.command_handler_holding_job_lock != command_handler)))
    if (failed_lock or failed_unlock):
        return False
    if lock:
        self.command_handler_holding_job_lock = command_handler
    else:
        self.command_handler_holding_job_lock = None
    return True
Set a worker level job lock so we don't try to hold onto 2 jobs at
anytime
def set_job_lock(self, command_handler, lock):
    "Set a worker level job lock so we don't try to hold onto 2 jobs at\n        anytime"
    if (command_handler not in self.handler_to_connection_map):
        return False
    failed_lock = bool((lock and (self.command_handler_holding_job_lock is not None)))
    failed_unlock = bool(((not lock) and (self.command_handler_holding_job_lock != command_handler)))
    if (failed_lock or failed_unlock):
        return False
    if lock:
        self.command_handler_holding_job_lock = command_handler
    else:
        self.command_handler_holding_job_lock = None
    return True