Lines Matching refs:Threads
22 #include "Threads.h"
27 Threads threads(&pointers, 1);
28 Thread* thread = threads.CreateThread(900);
30 ASSERT_EQ(1U, threads.num_threads());
32 Thread* found_thread = threads.FindThread(900);
39 threads.Finish(thread);
41 ASSERT_EQ(0U, threads.num_threads());
47 Threads threads(&pointers, 1);
48 Thread* thread1 = threads.CreateThread(900);
50 ASSERT_EQ(1U, threads.num_threads());
52 Thread* thread2 = threads.CreateThread(901);
54 ASSERT_EQ(2U, threads.num_threads());
56 Thread* thread3 = threads.CreateThread(902);
58 ASSERT_EQ(3U, threads.num_threads());
60 Thread* found_thread1 = threads.FindThread(900);
63 Thread* found_thread2 = threads.FindThread(901);
66 Thread* found_thread3 = threads.FindThread(902);
74 threads.Finish(thread1);
75 ASSERT_EQ(2U, threads.num_threads());
78 threads.Finish(thread3);
79 ASSERT_EQ(1U, threads.num_threads());
82 threads.Finish(thread2);
83 ASSERT_EQ(0U, threads.num_threads());
89 Threads threads(&pointers, 1);
90 Thread* thread = threads.CreateThread(900);
92 ASSERT_EQ(1U, threads.num_threads());
99 threads.WaitForAllToQuiesce();
103 threads.WaitForAllToQuiesce();
108 threads.Finish(thread);
109 ASSERT_EQ(0U, threads.num_threads());
115 Threads threads(&pointers, 1);
116 for (size_t i = 0; i <= threads.max_threads(); i++) {
117 Thread* thread = threads.CreateThread(900+i);
118 ASSERT_EQ(thread, threads.FindThread(900+i));