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

Method perform_test

dlib/test/read_write_mutex.cpp:161–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160
161 void perform_test (
162 )
163 {
164 num_write = 0;
165 num_read = 0;
166 max_read = 0;
167 failure = false;
168
169 // doing this big block of weird stuff should have no effect.
170 {
171 m.unlock();
172
173 m.lock_readonly();
174 m.lock_readonly();
175 m.unlock();
176 m.unlock_readonly();
177 m.unlock();
178 m.unlock_readonly();
179
180 m.unlock();
181 m.unlock_readonly();
182
183 m.lock();
184 m.unlock_readonly();
185 m.unlock_readonly();
186 m.unlock();
187 }
188
189
190 // start up our testing threads
191 start();
192
193 // wait for the threads to finish
194 wait();
195
196
197 DLIB_TEST(failure == false);
198 DLIB_TEST_MSG(max_read == 6, "max_read: "<< max_read);
199
200 }
201
202 } a;
203

Callers

nothing calls this directly

Calls 5

startFunction · 0.85
unlock_readonlyMethod · 0.80
unlockMethod · 0.45
lock_readonlyMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected