我有一个使用2个线程的应用程序。我希望能够通过等待条件变量exitCondition来关闭这两个线程。我使用python 3.3,它与python 2.7不同,当条件被通知时,threading.Condition.wait()返回True,当超时发生时返回False。 #!/usr/bin/python
import threading
from time import sleep
ex
should_go = False
cv = Condition()
while True:
with cv:
if not should_go:
cv.wait()
if should_go:
# process_time_cost_tasks()
should_go = False
def request()