| 204 | // ---------------------------------------------------------------------------------------- |
| 205 | |
| 206 | void multithreaded_object:: |
| 207 | thread_helper( |
| 208 | ) |
| 209 | { |
| 210 | mfp mf; |
| 211 | thread_id_type id = get_thread_id(); |
| 212 | |
| 213 | // this guy's destructor does all the necessary cleanup in this function |
| 214 | raii_thread_helper raii(*this, id); |
| 215 | |
| 216 | // if there is a dead_thread sitting around then pull it |
| 217 | // out and put it into mf |
| 218 | { |
| 219 | auto_mutex M(m_); |
| 220 | if (dead_threads.size() > 0) |
| 221 | { |
| 222 | dead_threads.dequeue(mf); |
| 223 | mfp temp(mf); |
| 224 | thread_ids.add(id,temp); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | if (mf.is_set()) |
| 229 | { |
| 230 | // call the registered thread function |
| 231 | mf(); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | // ---------------------------------------------------------------------------------------- |
| 236 |
nothing calls this directly
no test coverage detected