Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
 def get_worker_name():
     names.append(pthread.getname())
     done.wait()
Ejemplo n.º 4
0
 def get_worker_name():
     names.append(pthread.getname())
     done.wait()
Ejemplo n.º 5
0
 def run():
     pthread.setname(NAME)
     names[0] = pthread.getname()
     self.ready.set()
     self.done.wait()
Ejemplo n.º 6
0
 def run():
     pthread.setname(NAME)
     names[0] = pthread.getname()
     self.ready.set()
     self.done.wait()