17 lines
340 B
Python
17 lines
340 B
Python
#import threading
|
|
import multiprocessing
|
|
import time
|
|
|
|
class MyThread(threading.Thread):
|
|
|
|
def run(self):
|
|
time.sleep(5)
|
|
return
|
|
|
|
if __name__ == '__main__':
|
|
for i in range(3):
|
|
t = MyThread()
|
|
t.start()
|
|
print(t.name, 'is alive -> ',t.is_alive())
|
|
t.join()
|
|
print(t.name, 'is alive -> ',t.is_alive()) |