| 249 | // ---------------------------------------------------------------------------------------- |
| 250 | |
| 251 | void threaded_object:: |
| 252 | thread_helper( |
| 253 | ) |
| 254 | { |
| 255 | #ifdef ENABLE_ASSERTS |
| 256 | id1 = get_thread_id(); |
| 257 | id_valid = true; |
| 258 | #endif |
| 259 | while (true) |
| 260 | { |
| 261 | m_.lock(); |
| 262 | should_respawn_ = false; |
| 263 | m_.unlock(); |
| 264 | |
| 265 | thread(); |
| 266 | |
| 267 | auto_mutex M(m_); |
| 268 | |
| 269 | if (should_respawn_) |
| 270 | continue; |
| 271 | |
| 272 | #ifdef ENABLE_ASSERTS |
| 273 | id_valid = false; |
| 274 | #endif |
| 275 | |
| 276 | is_alive_ = false; |
| 277 | is_running_ = false; |
| 278 | should_stop_ = false; |
| 279 | s.broadcast(); |
| 280 | |
| 281 | return; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | // ---------------------------------------------------------------------------------------- |
| 286 |
nothing calls this directly
no test coverage detected