| 100 | // ---------------------------------------------------------------------------------------- |
| 101 | |
| 102 | void threaded_object:: |
| 103 | start ( |
| 104 | ) |
| 105 | { |
| 106 | auto_mutex M(m_); |
| 107 | |
| 108 | DLIB_ASSERT(id1 != get_thread_id() || id_valid == false, |
| 109 | "\tvoid threaded_object::start()" |
| 110 | << "\n\tYou can NOT call this function from the thread that executes threaded_object::thread" |
| 111 | << "\n\tthis: " << this |
| 112 | ); |
| 113 | |
| 114 | if (is_alive_ == false) |
| 115 | { |
| 116 | if (create_new_thread<threaded_object,&threaded_object::thread_helper>(*this) == false) |
| 117 | { |
| 118 | is_running_ = false; |
| 119 | throw thread_error(); |
| 120 | } |
| 121 | } |
| 122 | is_alive_ = true; |
| 123 | is_running_ = true; |
| 124 | should_stop_ = false; |
| 125 | s.broadcast(); |
| 126 | } |
| 127 | |
| 128 | // ---------------------------------------------------------------------------------------- |
| 129 |
nothing calls this directly
no test coverage detected