pocketmine\Worker::quit PHP Method

quit() public method

Stops the thread using the best way possible. Try to stop it yourself before calling this.
public quit ( )
    public function quit()
    {
        $this->isKilled = true;
        $this->notify();
        if ($this->isRunning()) {
            $this->shutdown();
            $this->notify();
            $this->unstack();
        } elseif (!$this->isJoined()) {
            if (!$this->isTerminated()) {
                $this->join();
            }
        }
        ThreadManager::getInstance()->remove($this);
    }