void FlushableTaskQueue::Flush() { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); AwaitIdleLocked(); }
void MediaTaskQueue::Flush() { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); while (!mTasks.empty()) { mTasks.pop(); } AwaitIdleLocked(); }
nsresult MediaTaskQueue::FlushAndDispatch(TemporaryRef<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); nsresult rv = DispatchLocked(aRunnable, IgnoreFlushing); NS_ENSURE_SUCCESS(rv, rv); AwaitIdleLocked(); return NS_OK; }
nsresult FlushableTaskQueue::FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); nsCOMPtr<nsIRunnable> r = dont_AddRef(aRunnable.take()); nsresult rv = DispatchLocked(r.forget(), IgnoreFlushing, AssertDispatchSuccess); NS_ENSURE_SUCCESS(rv, rv); AwaitIdleLocked(); return NS_OK; }