void* GUIAction::thread_start(void *cookie) { GUIAction* ourThis = (GUIAction*) cookie; DataManager::SetValue(TW_ACTION_BUSY, 1); if (ourThis->mActions.size() > 1) { std::vector<Action>::iterator iter; for (iter = ourThis->mActions.begin(); iter != ourThis->mActions.end(); iter++) ourThis->doAction(*iter, 1); } else { ourThis->doAction(ourThis->mActions.at(0), 1); } DataManager::SetValue(TW_ACTION_BUSY, 0); return NULL; }
void ActionThread::run(void *data) { ThreadData *d = (ThreadData*) data; GUIAction* act = d->act; for (auto it = act->mActions.begin(); it != act->mActions.end(); ++it) { act->doAction(*it); } pthread_mutex_lock(&m_act_lock); m_thread_running = false; pthread_mutex_unlock(&m_act_lock); delete d; }
void ActionThread::run(void *data) { ThreadData *d = (ThreadData*)data; GUIAction* act = d->act; std::vector<GUIAction::Action>::iterator it; for (it = act->mActions.begin(); it != act->mActions.end(); ++it) act->doAction(*it); pthread_mutex_lock(&m_act_lock); m_thread_running = false; pthread_mutex_unlock(&m_act_lock); delete d; }