152 |
152 |
153 @param id the id the current thread should be set to. |
153 @param id the id the current thread should be set to. |
154 """ |
154 """ |
155 try: |
155 try: |
156 self.lockClient() |
156 self.lockClient() |
157 if id is None: |
157 if id is None or id not in self.threads: |
158 self.currentThread = None |
158 self.currentThread = None |
159 else: |
159 else: |
160 self.currentThread = self.threads[id] |
160 self.currentThread = self.threads[id] |
161 finally: |
161 finally: |
162 self.unlockClient() |
162 self.unlockClient() |