def configure_prologue(testbench_config):
    """
    If a prologue thread is added, add it to all test vectors and delay other
    threads to wait for it to finish

    Args:
        testbench_config (Testbench): The user-defined testbench configuration

    Returns:
        Testbench: Updated testbench configuration
    """
    if testbench_config.prologue_thread is None:
        return testbench_config
    prologue_thread = testbench_config.prologue_thread
    prologue_thread.commands.insert(
        0, {"signal": {"name": "test_prologue", "value": 1}}
    )
    prologue_thread.set_signal("test_prologue", 0)
    for vector in testbench_config.vectors:
        for thread in vector.threads:
            thread.commands.insert(
                0, {"wait": {"key": "@(negedge test_prologue);"}}
            )
        vector.add_thread(prologue_thread)
    return testbench_config