import time
from multiprocessing import Pool
biaozhi = False
t1 = "第一线程"
t2 = "第二线程"
t3 = "第三线程"
t4 = "第四线程"
t5 = []
def xianzaishijian():
print(time.asctime(time.localtime(time.time())))
def main(tt):
while True:
if biaozhi is True:
time.sleep(3)
else:
break
biaozhi = True
xianzaishijian()
print(tt)
biaozhi = False
if name == "__main__":
t5.append(t1)
t5.append(t2)
t5.append(t3)
t5.append(t4)
pool = Pool(5)
pool.map(main,t5)
pool.close()
pool.join()
错误信息
UnboundLocalError: local variable 'biaozhi' referenced before assignment
到底哪里错了