def METHOD_NAME(lockA, lockB, task_class, num_tasks):
    """
    Simple test to start a lot of tasks that acquire/release the same two locks.
    We want to make sure that the test itself has sound logic,
    so it is written to be agnostic to the lock/task type.
    This test should work for both Requests (with RequestLocks) or 'normal'
    threading.Threads and Locks (as long as the API is adapted a bit to look
    like Requests via ThreadRequest, above.)
    """
    global paused
    paused = True
    progressAB = [0, 0]
    # Prepare
    lockB.acquire()
    def f1():
        """
        A.acquire(); B.release()
        """
        time.sleep(random.random() / 1000.0)
        lockA.acquire()
        logger.debug("Acquired A. Progress: {}".format(progressAB[0]))
        while paused:
            pass
        assert lockB.locked()
        lockB.release()
        progressAB[0] += 1
        if isinstance(lockA, RequestLock):
            logger.debug("lockA.pending: {}".format(len(lockA._pendingRequests)))
    def f2():
        """
        B.acquire(); A.release()
        """
        time.sleep(random.random() / 1000.0)
        lockB.acquire()
        logger.debug("Acquired B. Progress: {}".format(progressAB[1]))
        while paused:
            pass
        assert lockA.locked()
        lockA.release()
        progressAB[1] += 1
        if isinstance(lockB, RequestLock):
            logger.debug("lockB.pending: {}".format(len(lockB._pendingRequests)))
    tasks = []
    for _ in range(num_tasks):
        tasks.append(task_class(f1))
        tasks.append(task_class(f2))
    for task in tasks:
        task.submit()
    logger.debug("Pause for tasks to finish queuing.....")
    time.sleep(0.1)
    paused = False
    for task in tasks:
        task.wait()
    lockA.acquire()  # A should be left in released state.
    lockB.release()
    logger.debug("DONE")