| 52 | // ========================================================================= |
| 53 | |
| 54 | bool Thread::startThread() { |
| 55 | if (_threadExecuteFunction == nullptr) { |
| 56 | return false; |
| 57 | } |
| 58 | _state = State::Unknown; |
| 59 | const int threadCreate = pthread_create(&_thread, nullptr, threadEntryFunc, this); |
| 60 | if (threadCreate == 0) { |
| 61 | _state = State::Starting; |
| 62 | return true; |
| 63 | } |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | void Thread::stopThread() { |
| 68 | if (_state == State::Unknown) { |
no test coverage detected