void Task::execute() { m_status = TaskStatus::Running; try { m_action(); m_status = TaskStatus::Completed; // post next tasks for (auto& n : m_nextTasks) { if (n.dispatcher) { n.dispatcher->post(n.task); } } } catch (Exception& e) { m_exception = e.copy(); m_status = TaskStatus::Faulted; } catch (...) { m_exception = LN_NEW Exception(); m_status = TaskStatus::Faulted; } m_waiting.unlock(); }
bool parse(Iterator& begin, Iterator end) const { Iterator o = begin; if (Parser::parse(begin, end)) { m_action(o, begin); return true; } return false; }
bool operator () (const TPTree &tree) const { kvalue_type real_val = get(tree, m_key_name); if (real_val == m_key_value) { m_action(tree); return true; } return false; }
~ScopeGuard() { m_action(); }
void TeleportWindowAction::execute(TeleportTarget *target) { m_action(target); }
void run(){ if(m_action) m_action(); }