Lines Matching refs:thread
8 import _thread as thread
15 signalled_all=thread.allocate_lock()
31 signal_blackboard[sig]['tripped_by'] = thread.get_ident()
33 # a function that will be spawned as a separate thread.
47 # We spawn a thread, have the thread send two signals, and
49 # and that they were run by the main thread.
56 # (it might even be after the thread exits
70 thread.get_ident())
73 thread.get_ident())
77 thread.start_new_thread(send_signals, ())
98 lock = thread.allocate_lock()
129 rlock = thread.RLock()
131 # thread.
136 thread.start_new_thread(other_thread, ())
159 # Acquire the lock in a non-main thread, so this test works for
162 # Wait until the main thread is blocked in the lock acquire, and
166 # Let the main thread take the interrupt, handle it, and retry
172 thread.start_new_thread(other_thread, ())
184 self.acquire_retries_on_intr(thread.allocate_lock())
187 self.acquire_retries_on_intr(thread.RLock())
192 # acquire in the main thread, and make sure that the lock acquire times
195 # to the main thread. Otherwise lock.acquire() itself doesn't get
200 done = thread.allocate_lock()
202 lock = thread.allocate_lock()
219 # Send the signals from the non-main thread, since the main thread
221 thread.start_new_thread(send_signals, ())
223 # Wait for thread to finish