我有4个线程,我想看看它们是否还活着并已正确启动。
is_alive()
不返回任何内容,但是在我的日志文件中看到该进程正在运行。
def session_start()
while True:
# here I poll my database and send request and
# store response result back to database
def main():
session_start_thread = Thread(app.session_start())
print('Starting thread 1...')
session_start_thread.start()
if session_start_thread.is_alive():
print('Thread 1 is runnning')
else:
print("Thread 1 wasn't started")