摘要:
#!/usr/bin/env python # -*-coding:utf-8-*- import threading import time condition = threading.Condition() products = 0 class Producer(threading.Thread 阅读全文
摘要:
import time import threading def printNum(a): print ('num:',a) time.sleep(5) def ThreadTest(i): return threading.Thread(target=printNum, args=(999,)) 阅读全文
摘要:
#-*-coding:utf-8-*- import threading import time event = threading.Event() def func(): # 等待事件,进入等待阻塞状态 print( '%s wait for event...' % threading.curre 阅读全文