use threading.Event() to wait finish task instead of finFlag