# -*- coding: utf-8 -*-
from threading import Thread, Lock
def my_func():
"""完成耗时的工作"""
pass
def long_time_task():
ths = []
for _ in range(10): # 开启10个线程
th = Thread(target=my_func)
th.start()
ths.append(th)
for th in ths:
th.join()
if __name__ == "__main__":
long_time_task()