* Thread entry point. * * This thread spends most of its time blocking on getline. It loops until * stdin goes bad or the thread is stopped before it blocks on getline * again. Most of the time this thread can't be stopped because quit isn't * called until after it is blocking again. */
| 55 | * called until after it is blocking again. |
| 56 | */ |
| 57 | virtual void Run() |
| 58 | { |
| 59 | soar_thread::Lock* lock; |
| 60 | while (!this->m_QuitNow && std::cin.good()) |
| 61 | { |
| 62 | std::getline(std::cin, line); |
| 63 | if (std::cin.bad()) |
| 64 | { |
| 65 | break; |
| 66 | } |
| 67 | |
| 68 | lock = new soar_thread::Lock(&mutex); |
| 69 | lines.push(line); |
| 70 | write_event.TriggerEvent(); |
| 71 | if (line == "quit" || line == "exit") |
| 72 | { |
| 73 | this->m_QuitNow = true; |
| 74 | } |
| 75 | delete lock; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Get a line of input, block until it is received. |
nothing calls this directly
no test coverage detected