void Group::restart(const Options &options, RestartMethod method) { boost::container::vector<Callback> actions; assert(isAlive()); P_DEBUG("Restarting group " << getName()); // If there is currently a restarter thread or a spawner thread active, // the following tells them to abort their current work as soon as possible. restartsInitiated++; processesBeingSpawned = 0; m_spawning = false; m_restarting = true; uuid = generateUuid(pool); detachAll(actions); getPool()->interruptableThreads.create_thread( boost::bind(&Group::finalizeRestart, this, shared_from_this(), this->options.copyAndPersist().clearPerRequestFields(), options.copyAndPersist().clearPerRequestFields(), method, getContext()->getSpawningKitFactory(), restartsInitiated, actions), "Group restarter: " + getName(), POOL_HELPER_THREAD_STACK_SIZE ); }
Item* Item::detachAll(Bag* container) { for (ArrayList<Item*>::iterator itr = container->items.begin(); itr != container->items.end(); itr++) { Item* item = *itr; if (item == this) { container->items.remove(this); item->onDetach(); QuickSlot::refresh(); return this; } else if (dynamic_cast<Bag*>(item)) { Bag* bag = (Bag*)item; if (bag->contains(this)) { return detachAll(bag); } } } return this; }
FullScreen::~FullScreen() { detachAll(); }
void FullScreen::closeEvent(QCloseEvent* _event) { detachAll(); }