MCPcopy Create free account
hub / github.com/davisking/dlib / thread

Method thread

dlib/test/threads.cpp:125–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 void thread10() { thread(10); }
124
125 void thread (
126 int num
127 )
128 {
129 dlog << LTRACE << "starting thread num " << num;
130 if (is_dlib_thread())
131 register_thread_end_handler(*this,&threads_tester::thread_end_handler);
132 tsd.data() = num;
133 for (int i = 0; i < 0x3FFFF; ++i)
134 {
135 if ((i&0xFFF) == 0)
136 {
137 print_spinner();
138 dlib::sleep(10);
139 }
140 // if this isn't equal to num then there is a problem with the thread specific data stuff
141 if (tsd.data() != num)
142 {
143 auto_mutex M(cm);
144 failure = true;
145 sm.signal();
146 }
147 }
148 dlog << LTRACE << "ending of thread num " << num;
149
150
151 }
152 } a;
153
154

Callers

nothing calls this directly

Calls 6

is_dlib_threadFunction · 0.85
print_spinnerFunction · 0.85
sleepFunction · 0.50
dataMethod · 0.45
signalMethod · 0.45

Tested by

no test coverage detected