public function then(callable $code)
    {
        if (!call_user_func($this->check)) {
            return false;
        }

        return $this->mutex->synchronized(function () use ($code) {
            if (!call_user_func($this->check)) {
                return false;
            }

            return $code();
        });
    }