@Override
    public void cancel() {
        if (!mDone) {
            synchronized (this) {
                mDone = true;

                // clear the task form pool
                if (mPool != null) {
                    //noinspection SynchronizeOnNonFinalField
                    synchronized (mPool) {
                        if (mPool != null) {
                            try {
                                mPool.remove(this);
                            } catch (Exception e) {
                                e.getStackTrace();
                            } finally {
                                mPool = null;
                            }
                        }
                    }
                }
            }
        }
    }
Wait for a period of time to run end

@param waitMillis      wait milliseconds time
@param waitNanos       wait nanoseconds time
@param cancelOnTimeOut when wait end cancel the runner
caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/ActionSyncTask.java