Lines Matching refs:task
31 * <p>The initial state is to allow all tasks to be started and finished. A task may only be started
32 * once, after which it must be finished before starting again. Likewise, finishing a task
69 * Create a new task drainer; {@code onDrained} callbacks will be posted to the listener
82 * Create a new task drainer; {@code onDrained} callbacks will be posted to the listener
97 * Mark an asynchronous task as having started.
99 * <p>A task cannot be started more than once without first having finished. Once
102 * @param task a key to identify a task
108 * If attempting to start a task which is already started (and not finished),
109 * or if attempting to start a task after draining has begun.
111 public void taskStarted(T task) {
114 Log.v(TAG + "[" + mName + "]", "taskStarted " + task);
121 if (!mTaskSet.add(task)) {
122 throw new IllegalStateException("Task " + task + " was already started");
129 * Mark an asynchronous task as having finished.
131 * <p>A task cannot be finished if it hasn't started. Once finished, a task
134 * @param task a key to identify a task
140 * If attempting to start a task which is already finished (and not re-started),
142 public void taskFinished(T task) {
145 Log.v(TAG + "[" + mName + "]", "taskFinished " + task);
148 if (!mTaskSet.remove(task)) {
149 throw new IllegalStateException("Task " + task + " was already finished");
152 // If this is the last finished task and draining has already begun, fire #onDrained