| 36 | } |
| 37 | |
| 38 | void thread_base::start() { |
| 39 | if(thread_status != THREAD_STATUS::INIT) { |
| 40 | // something is wrong, return (thread status must be init!) |
| 41 | cout << "ERROR: thread error: thread status must be INIT before starting the thread!" << endl; |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | thread_status = THREAD_STATUS::RUNNING; |
| 46 | this->unlock(); |
| 47 | } |
| 48 | |
| 49 | void thread_base::restart() { |
| 50 | this->lock(); |