staticvoid disposeThreadWithLock(std::unique_lock<std::mutex>& g)
{ if (wakeupThread)
{ auto holdRef = wakeupThread;
wakeupThread.clear();
holdRef->stopWithLock(g);
}
assert(!wakeupThread);
}
staticvoid add(css::uno::WeakReference<css::util::XUpdatable> up)
{
std::unique_lock g(getMutex());
updatables.push_back(up); if (!wakeupThread)
wakeupThread = new SharedWakeUpThread();
}
staticvoid remove(css::uno::WeakReference<css::util::XUpdatable> up)
{
std::unique_lock g(getMutex()); auto it = updatables.begin(); bool found = false; for (; it != updatables.end(); ++it)
{
css::uno::Reference<css::util::XUpdatable> itValid(*it); if (!itValid || *it == up)
{
it = updatables.erase(it);
found = true; break;
}
}
(void)found; assert(found); if (updatables.empty())
disposeThreadWithLock(g);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.