def do_cleanThreads(cls):
from twisted.internet import reactor
if interfaces.IReactorThreads.providedBy(reactor):
reactor.suggestThreadPoolSize(0)
if hasattr(reactor, 'threadpool') and reactor.threadpool:
reactor.threadpool.stop()
reactor.threadpool = None
# *Put it back* and *start it up again*. The
# reactor's threadpool is *private*: we cannot just
# rape it and walk away.
reactor.threadpool = threadpool.ThreadPool(0, 10)
reactor.threadpool.start()
评论列表
文章目录