threadpool 4

     def __set_run_event(self, running):
        if self.__RunningEvent.isSet() and (not running):
            if self.notifyrun:
                self.notifyrun(running)
        elif (not self.__RunningEvent.isSet()) and running:
            if self.notifyrun:
                self.notifyrun(running)

        if running:
            self.__RunningEvent.set()
            self.__RunEndEvent.clear()
        else:
            self.__RunningEvent.clear()
            self.__RunEndEvent.set()
##            print 'after clear = ', self.__RunningEvent.isSet()
    def reset_target(self, target=None, *args, **kwargs):
        threading.Thread.__init__(self, None, target, None, *args, **kwargs)
##        self.__set_run_event(False)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章