def test_name_set_doesnt_change_parent(self): HELPER_NAME = "helper-name" parent_name = pthread.getname() def run(): pthread.setname(HELPER_NAME) self.ready.set() self.done.wait() threading.Thread(target=run).start() self.ready.wait() self.assertEqual(parent_name, pthread.getname()) self.done.set()
def get_worker_name(): names.append(pthread.getname()) done.wait()
def run(): pthread.setname(NAME) names[0] = pthread.getname() self.ready.set() self.done.wait()