def __exit__(self, *unused): self.mExecutor.mMultiThreadDispatcher.stop() Log.noticeNoBlock("Multi-threading phase exited.") ThreadDispatcher.setCurrentDispatcher( self.mExecutor.mSingleThreadDispatcher ) return False
def createGenThreadExecutor(genThreadCount, interface): if genThreadCount == 1: executor = SingleGenThreadExecutor() else: executor = MultiGenThreadExecutor(interface) ThreadDispatcher.setCurrentDispatcher(executor.mSingleThreadDispatcher) return executor
def __enter__(self): ThreadDispatcher.setCurrentDispatcher(self.mExecutor.mMultiThreadDispatcher) for gen_thread in self.mExecutor.mGenThreads: self.mExecutor.mMultiThreadDispatcher.addThreadId(gen_thread.genThreadID) self.mExecutor.mMultiThreadDispatcher.start() Log.noticeNoBlock("Multi-threading phase entered.") return self
def __init__(self): self.mDispatcher = ThreadDispatcher.getCurrentDispatcher()