import threading


def start_thread(event):
    """
    Start a thread that waits on a given event, then terminates.
    Used for determining how many threads can be successfully
    started before Python or OS reaches an upper limit.
    """

    def dummy_thread(event):
        """
        Simply wait on event to keep thread active.
        """
        event.wait()

    t = threading.Thread(target=dummy_thread, args=(event,))
    t.start()
    return t