142 self.updateThreadList() |
142 self.updateThreadList() |
143 |
143 |
144 threadList = [] |
144 threadList = [] |
145 currentId = _thread.get_ident() |
145 currentId = _thread.get_ident() |
146 # update thread names set by user (threading.setName) |
146 # update thread names set by user (threading.setName) |
147 threadNames = {t.ident: t.getName() for t in threading.enumerate()} |
147 threadNames = {t.ident: t.name for t in threading.enumerate()} |
148 |
148 |
149 for threadId, thd in self.threads.items(): |
149 for threadId, thd in self.threads.items(): |
150 d = {"id": threadId} |
150 d = {"id": threadId} |
151 try: |
151 try: |
152 d["name"] = threadNames.get(threadId, thd.name) |
152 d["name"] = threadNames.get(threadId, thd.name) |