【发布时间】:2013-02-25 09:39:06
【问题描述】:
如何查看线程是否已完成?我尝试了以下方法,但threads_list 不包含已启动的线程,即使我知道该线程仍在运行。
import thread
import threading
id1 = thread.start_new_thread(my_function, ())
#wait some time
threads_list = threading.enumerate()
# Want to know if my_function() that was called by thread id1 has returned
def my_function()
#do stuff
return
【问题讨论】:
标签: python multithreading