[tuxdroid-svn] r933 - api/python/trunk
Status: Beta
Brought to you by:
ks156
From: remi <c2m...@c2...> - 2008-03-06 14:26:09
|
Author: remi Date: 2008-03-06 15:25:58 +0100 (Thu, 06 Mar 2008) New Revision: 933 Modified: api/python/trunk/tuxapi_class.py Log: UPD: EventHandler : Cleaning of expired events. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-03-05 16:48:12 UTC (rev 932) +++ api/python/trunk/tuxapi_class.py 2008-03-06 14:25:58 UTC (rev 933) @@ -89,6 +89,13 @@ self.__list_mutex.acquire() self.__funct_ptr_list[idx] = None self.__list_mutex.release() + + def __refresh_threads_list(self): + nl = [] + for t in self.__threads_list: + if t.isAlive(): + nl.append(t) + self.__threads_list = nl def __run(self, funct_ptr, idx, fargs): try: @@ -111,6 +118,7 @@ self.__list_mutex.release() for idx, funct_ptr in enumerate(funct_ptr_list): if funct_ptr != None: + self.__refresh_threads_list() t=threading.Thread(target=self.__run, args=(funct_ptr, idx, fargs)) t.setName('EventControl') t.start() @@ -6133,7 +6141,7 @@ try: if self.__process != None: os.kill(self.__process.pid, signal.SIGKILL) - os.waitpid(-1, os.WNOHANG) + #os.waitpid(-1, os.WNOHANG) except: pass self.__process_mutex.release() |