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

Function thread

dlib/sockets/sockets_extensions.cpp:155–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 };
154
155 void thread(void* param)
156 {
157 thread_data p = *static_cast<thread_data*>(param);
158 try
159 {
160 p.con = connect(p.host_or_ip, p.port);
161 }
162 catch (...)
163 {
164 p.error_occurred = true;
165 }
166
167 auto_mutex M(connect_mutex);
168 // report the results back to the connect() call that spawned this
169 // thread.
170 static_cast<thread_data*>(param)->con = p.con;
171 static_cast<thread_data*>(param)->error_occurred = p.error_occurred;
172 connect_signaler.broadcast();
173
174 // wait for the call to connect() that spawned this thread to terminate
175 // before we delete the thread_data struct.
176 while (static_cast<thread_data*>(param)->connect_ended == false)
177 connect_signaler.wait();
178
179 connect_signaler.broadcast();
180 --outstanding_connects;
181 delete static_cast<thread_data*>(param);
182 }
183 }
184
185 connection* connect (

Callers 13

perform_testMethod · 0.50
thread1Method · 0.50
thread2Method · 0.50
thread3Method · 0.50
thread4Method · 0.50
thread5Method · 0.50
thread6Method · 0.50
thread7Method · 0.50
thread8Method · 0.50
thread9Method · 0.50
thread10Method · 0.50
thread_helperMethod · 0.50

Calls 3

connectFunction · 0.85
broadcastMethod · 0.45
waitMethod · 0.45

Tested by 11

perform_testMethod · 0.40
thread1Method · 0.40
thread2Method · 0.40
thread3Method · 0.40
thread4Method · 0.40
thread5Method · 0.40
thread6Method · 0.40
thread7Method · 0.40
thread8Method · 0.40
thread9Method · 0.40
thread10Method · 0.40