| 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 |
nothing calls this directly
no test coverage detected