1
現在,我的父線程啓動子線程,然後進入time.sleep()一段時間。有什麼辦法可以讓我的父線程睡覺或thread.join()? (如果我沒記錯的Thread.join()是等待子線程完成一個)如何使父線程等待指定的時間或直到子線程完成?
thread = threading.Thread(target=whatever, args=yeah)
thread.start()
#here wait till either 60 seconds has passed or the child thread finishes, which ever comes first
#if 60 passes stop child thread (I already have a way to do this)
#continue doing other stuff