Lines Matching refs:thread
6 import _thread as thread
18 _print_mutex = thread.allocate_lock()
30 self.done_mutex = thread.allocate_lock()
32 self.running_mutex = thread.allocate_lock()
33 self.random_mutex = thread.allocate_lock()
48 thread.start_new_thread(self.task, (self.next_ident,))
65 # Basic test for thread creation.
74 self.assertEqual(thread.stack_size(), 0, "initial stack size is not 0")
76 thread.stack_size(0)
77 self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
82 thread.stack_size(4096)
86 except thread.error:
87 self.skipTest("platform does not support changing thread stack "
92 thread.stack_size(tss)
93 self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
108 thread.stack_size(0)
112 orig = thread._count()
113 mut = thread.allocate_lock()
123 thread.start_new_thread(task, ())
126 self.assertEqual(thread._count(), orig + 1)
129 # The only reliable way to be sure that the thread ended from the
138 self.assertEqual(thread._count(), orig)
145 started = thread.allocate_lock()
149 thread.start_new_thread(task, ())
155 "Exception ignored in thread started by")
163 self.checkin_mutex = thread.allocate_lock()
164 self.checkout_mutex = thread.allocate_lock()
191 thread.start_new_thread(self.task2, (i,))
214 # Must release mutex before releasing done, else the main thread can
222 locktype = thread.allocate_lock
237 # fork in a thread
251 thread.start_new_thread(fork_thread, (self.read_fd, self.write_fd))