@WorkerThread
    private void endAsynchronousRun(final R result, final Throwable runException, final I input, final Disposable lTaskDisposable) {
        synchronized (taskMutex) {

            final boolean wasCancelled = lTaskDisposable != this.taskDisposable;

            if (Log.isEnabled(Log.LogLevel.INFO) || runException != null) {
                final String logData = " (input=" + input + ", result=" + result + ", wasCancelled=" + wasCancelled + ", duration=" + (System.currentTimeMillis() - lastStartTimeMillis);
                if (runException == null) {
                    Log.i(getLogPraefix(globalId) + "End run" + logData);
                } else {
                    Log.w(getLogPraefix(globalId) + "End run with ERROR" + logData, runException);
                }
            }

            //end the run
            lTaskDisposable.dispose();
            if (wasCancelled) {
                //task run was cancelled/restarted inbetween -> don't forward task end events
                return;
            }
            this.taskDisposable = null;
            if (runException != null) {
                //post error result
                postEvent(new WorkerTaskEvent<>(this, WorkerTaskEventType.ERROR, null, null, null, runException));
            } else {
                //post results
                postEvent(new WorkerTaskEvent<>(this, WorkerTaskEventType.RESULT, null, null, result, null));
            }
        }
    }
Call this method to "finish" a task (means: when result is processed)
main/src/main/java/cgeo/geocaching/utils/workertask/WorkerTask.java