def test(self): self.lock = _thread.allocate_lock() for i in range(0, 10): _thread.start_new_thread(self.runnable, ())