示例#1
0
 def __exit__(self, *unused):
     self.mExecutor.mMultiThreadDispatcher.stop()
     Log.noticeNoBlock("Multi-threading phase exited.")
     ThreadDispatcher.setCurrentDispatcher(
         self.mExecutor.mSingleThreadDispatcher
     )
     return False
示例#2
0
    def createGenThreadExecutor(genThreadCount, interface):
        if genThreadCount == 1:
            executor = SingleGenThreadExecutor()
        else:
            executor = MultiGenThreadExecutor(interface)

        ThreadDispatcher.setCurrentDispatcher(executor.mSingleThreadDispatcher)
        return executor
示例#3
0
    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
示例#4
0
 def __init__(self):
     self.mDispatcher = ThreadDispatcher.getCurrentDispatcher()