Similar to #clear(), but this function also calls #Job.cancel() on all
    jobs. Also, it **includes** all jobs that are currently being executed if
    *cancel_current* is True.

    # Arguments
    cancel_current (bool): Also cancel currently running jobs and include them
      in the returned list of jobs.

    # Returns
    list: A list of the #Job#s that were canceled.

def cancel_all(self, cancel_current=True):
    """
    Similar to #clear(), but this function also calls #Job.cancel() on all
    jobs. Also, it **includes** all jobs that are currently being executed if
    *cancel_current* is True.

    # Arguments
    cancel_current (bool): Also cancel currently running jobs and include them
      in the returned list of jobs.

    # Returns
    list: A list of the #Job#s that were canceled.
    """

    with synchronized(self.__queue):
      jobs = self.clear()
      if cancel_current:
        jobs.extend(self.current_jobs())

    [j.cancel() for j in jobs]
    return jobs