| 24 | namespace concurrency { |
| 25 | |
| 26 | void Thread::threadMain(std::shared_ptr<Thread> thread) { |
| 27 | thread->setState(started); |
| 28 | thread->runnable()->run(); |
| 29 | |
| 30 | if (thread->getState() != stopping && thread->getState() != stopped) { |
| 31 | thread->setState(stopping); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | } |
| 36 | } |