Interrupts engine's JavaScript if it is still running after ms milliseconds.
More...
|
|
| Watchdog (QJSEngine *engine, int ms) |
| | Starts watching.
|
|
| ~Watchdog () |
| | Stops watching, and clears the interruption so the engine works again.
|
|
bool | fired () |
| | Whether the time ran out (valid once the evaluation returned).
|
|
|
QJSEngine * | m_engine |
| | Engine to interrupt.
|
|
std::mutex | m_mutex |
| | Guards m_finished and m_fired.
|
|
std::condition_variable | m_done |
| | Signals that the evaluation returned.
|
|
bool | m_finished = false |
| | Set when the evaluation returned.
|
|
bool | m_fired = false |
| | Set when the engine was interrupted.
|
|
std::thread | m_thread |
| | The watching thread.
|
Interrupts engine's JavaScript if it is still running after ms milliseconds.
QJSEngine::setInterrupted() is meant to be called from another thread, which is the only way to stop a loop that never returns to the event loop.
The documentation for this class was generated from the following file: