void PendingChecks::runChecks()
{
    DynMutex::Guard guard = m_mutex.lock();
    Checks::iterator it = m_checks.begin();
    bool removed = false;
    while (it != m_checks.end()) {
        bool cont;
        try {
            cont = (**it)();
        } catch (...) {
            Exception::handle(HANDLE_EXCEPTION_FATAL);
            // keep compiler happy
            cont = false;
        }

        if (!cont) {
            // Done with this check
            Checks::iterator next = it;
            ++next;
            m_checks.erase(it);
            it = next;
            removed = true;
        } else {
            ++it;
        }
    }
    // Tell blockOnCheck() calls that they may have completed.
    if (removed) {
        m_cond.signal();
    }
}
Exemple #2
0
 void finish() {
   for (Checks::iterator i = checks.begin(), e = checks.end(); i != e; ++i) i->finish();
   checks.clear();
 }
Exemple #3
0
 void start() {
   for (Checks::iterator i = checks.begin(), e = checks.end(); i != e; ++i) i->start();
 }