Example #1
0
 def test_ident_of_no_threading_threads(self):
     # The ident still must work for the main thread and dummy threads.
     self.assertFalse(threading.currentThread().ident is None)
     def f():
         ident.append(threading.currentThread().ident)
         done.set()
     done = threading.Event()
     ident = []
     thread.start_new_thread(f, ())
     done.wait()
     self.assertFalse(ident[0] is None)
     # Kill the "immortal" _DummyThread
     del threading._active[ident[0]]
Example #2
0
    def test_ident_of_no_threading_threads(self):
        # The ident still must work for the main thread and dummy threads.
        self.assertFalse(threading.currentThread().ident is None)

        def f():
            ident.append(threading.currentThread().ident)
            done.set()

        done = threading.Event()
        ident = []
        thread.start_new_thread(f, ())
        done.wait()
        self.assertFalse(ident[0] is None)
        # Kill the "immortal" _DummyThread
        del threading._active[ident[0]]
Example #3
0
 def f():
     ident.append(threading.currentThread().ident)
     done.set()
Example #4
0
 def f():
     ident.append(threading.currentThread().ident)
     done.set()