Home | History | Annotate | Download | only in test

Lines Matching refs:threading

1 # Very rudimentary test of threading module
11 threading = test.test_support.import_module('threading')
31 class TestThread(threading.Thread):
33 threading.Thread.__init__(self, name=name)
82 sema = threading.BoundedSemaphore(value=3)
83 mutex = threading.RLock()
109 self.assertFalse(threading.currentThread().ident is None)
111 ident.append(threading.currentThread().ident)
113 done = threading.Event()
119 del threading._active[ident[0]]
126 threading.stack_size(262144)
132 threading.stack_size(0)
139 threading.stack_size(0x100000)
145 threading.stack_size(0)
148 # Check that a "foreign" thread can use the threading module.
151 # thread to get made in the threading._active map.
152 threading.current_thread()
155 mutex = threading.Lock()
160 self.assertIn(tid, threading._active)
161 self.assertIsInstance(threading._active[tid], threading._DummyThread)
162 del threading._active[tid]
206 worker_started = threading.Event()
207 worker_saw_exception = threading.Event()
209 class Worker(threading.Thread):
260 _start_new_thread = threading._start_new_thread
261 threading._start_new_thread = fail_new_thread
263 t = threading.Thread(target=lambda: None)
266 t in threading._limbo,
269 threading._start_new_thread = _start_new_thread
311 # Avoid a deadlock when sys.settrace steps into threading._shutdown
313 import sys, threading
322 t = threading.Thread(target=killer)
328 threading.current_thread()
345 # Raising SystemExit skipped threading._shutdown
347 import threading
356 threading.Thread(target=child).start()
371 # threading.enumerate() after it has been join()ed.
372 enum = threading.enumerate
379 t = threading.Thread(target=lambda: None)
394 self.thread = threading.Thread(target=self._run,
424 import thread, threading, os, time
428 threading.current_thread()
432 evt = threading.Event()
435 assert threading.active_count() == 2, threading.active_count()
437 assert threading.active_count() == 1, threading.active_count()
458 import sys, os, time, threading
478 t = threading.Thread(target=joiningfunc,
479 args=(threading.current_thread(),))
497 t = threading.Thread(target=joiningfunc,
498 args=(threading.current_thread(),))
510 main_thread = threading.current_thread()
517 t = threading.Thread(target=joiningfunc,
523 w = threading.Thread(target=worker)
546 # Condition. (See threading.py:Thread.join().)
560 import os, time, threading
579 w = threading.Thread(target=worker)
589 call_count_lock = threading.Lock()
624 import os, time, threading
644 w = threading.Thread(target=worker)
684 t = threading.Thread(target=do_fork_and_wait)
696 thread = threading.Thread()
701 current_thread = threading.current_thread()
705 thread = threading.Thread()
709 thread = threading.Thread()
715 locktype = staticmethod(threading.Lock)
718 locktype = staticmethod(threading.RLock)
721 eventtype = staticmethod(threading.Event)
725 locktype = staticmethod(threading.Condition)
728 condtype = staticmethod(threading.Condition)
731 semtype = staticmethod(threading.Semaphore)
734 semtype = staticmethod(threading.BoundedSemaphore)
744 import threading
755 w = threading.Thread(target=outer)