please DO REMEMBER resume the hook

@param hook
197844
public void setRefreshCompleteHook(PtrUIHandlerHook hook) {
        mRefreshCompleteHook = hook;
        hook.setResumeAction(new Runnable() {
            @Override
            public void run() {
                if (DEBUG) {
                    PtrCLog.d(LOG_TAG, "mRefreshCompleteHook resume.");
                }
                notifyUIRefreshComplete(true);
            }
        });
    }
1251460
public synchronized void resume() {
        if (!paused) {
            Util.w(TAG, "require resume this queue(remain " + taskList.size() + "), but it is"
                    + " still running");
            return;
        }
        paused = false;

        if (!taskList.isEmpty() && !looping) {
            looping = true;
            startNewLooper();
        }
    }
926490
@LogExecTime
	public void dragAndDropWithPause(String locator, String targetLocator, int pause)
	{
		jtEvent.dragAndDropWithPause(locator, targetLocator, pause);
	}
1001439
public static function pause(string $hook, bool $state = true)
    {
        if (!isset(self::$hooks[$hook]))
            return;

        if ($state)
            self::$paused[$hook] = true;
        else if (isset(self::$paused[$hook]))
            unset(self::$paused[$hook]);
    }
655293
function executeHooks(data, allHooks, checkHooks, creationMode) {
    var hooksToCall = creationMode ? allHooks : checkHooks;
    if (hooksToCall) {
        callHooks(data, hooksToCall);
    }
}
119016
@FFDCIgnore(IllegalStateException.class)
    public void addShutdownHook() {
        try {
            if (hookSet.compareAndSet(false, true)) {
                Runtime.getRuntime().addShutdownHook(this);
            }
        } catch (IllegalStateException e) {
            // ok. based on timing, if we start shutting down, we may
            // not be able to remove the hook.
        }
    }
1235556
def callHook(self, hookname, *args, **kwargs):
        ''
        r = []
        for f in self.hooks[hookname]:
            try:
                r.append(f(*args, **kwargs))
            except Exception as e:
                exceptionCaught(e)
        return r
127440
protected function handleHookFailure(Hook $hook)
    {
        $this->failures[] = $hook;
        $title = $this->formatter->red($hook->getTitle());
        $leftPad = str_repeat(' ', self::TAB_SIZE * $this->depth);
        $this->console->writeLn($leftPad . $title);
    }
1107831
@Override
    public void run() {
        if (state.compareAndSet(State.STARTED, State.STOPPING)) {
            for (final Runnable hook : hooks) {
                try {
                    hook.run();
                } catch (final Throwable t) {
                    LOGGER.error(SHUTDOWN_HOOK_MARKER, "Caught exception executing shutdown hook {}", hook, t);
                }
            }
            state.set(State.STOPPED);
        }
    }
980627
public void deleteSystemHook(SystemHook hook) throws GitLabApiException {

        if (hook == null) {
            throw new RuntimeException("hook cannot be null");
        }

        deleteSystemHook(hook.getId());
    }
277363
public function unsetHook()
    {
        if ($this->hook_reference !== null)
        {
            Hook::unsubscribe(Hook::SHUTDOWN_HOOK, $this->hook_reference);
        }
    }
719094
private void doResume(long id) {
    if (paused) {
      log.debug(String.format("%s - Resumed connection to %s", this, context.target()));
      paused = false;
      checkDrain();
    }
  }
358393
def on_pause(self):
        """"""
        self.engine.commit()
        self.strings.save()
        self.funcs.save()
        self.config.write()
544393
public void reuse(Tag handler) {
        synchronized( this ) {
            if (current < (handlers.length - 1)) {
                handlers[++current] = handler;
                return;
            }
        }
        // There is no need for other threads to wait for us to release
        handler.release();
    }
100683
public static void add(int slot, boolean registerShutdownInProgress, Runnable hook) {
        synchronized (lock) {
            if (hooks[slot] != null)
                throw new InternalError("Shutdown hook at slot " + slot + " already registered");

            if (!registerShutdownInProgress) {
                if (state > RUNNING)
                    throw new IllegalStateException("Shutdown in progress");
            } else {
                if (state > HOOKS || (state == HOOKS && slot <= currentRunningHook))
                    throw new IllegalStateException("Shutdown in progress");
            }

            hooks[slot] = hook;
        }
    }
761405
public function addHook(Hook $hook)
    {
        if (isset($this->hooks[$hook->name]) === false) {
            $this->logger->debug(
                "Adding definition for hook '{$hook->name}' for the first time."
            );
            $this->hooks[$hook->name] = [];
        }

        $this->hooks[$hook->name][] = $hook->definition;
    }
6659
public void pause() {
        if (hasState(TICKING) && !hasState(PAUSED)) {
            if (DBG) Log.v(TAG, "pause. " + mEntries.size());
            mContentView.animate().cancel();
            addState(PAUSED);
            cancel(-1);
        }
    }