| 50 | } |
| 51 | } |
| 52 | void start() { |
| 53 | if (m_run || m_started) { |
| 54 | throw std::logic_error( |
| 55 | "Can't start if it's already started or if this is a re-start"); |
| 56 | } |
| 57 | m_started = true; |
| 58 | m_run = true; |
| 59 | m_thread = boost::thread([&] { |
| 60 | while (m_run) { |
| 61 | oneLoop(); |
| 62 | } |
| 63 | }); |
| 64 | } |
| 65 | |
| 66 | void oneLoop() { |
| 67 | m_mainloop.mainloop(); |