code: func (r *runtimeOCI) StopContainer(ctx context.Context, c *Container, timeout int64) error {
  	c.opLock.Lock()
  	defer c.opLock.Unlock()
  
  	// Check if the process is around before sending a signal
  	process, err := findprocess.FindProcess(c.state.Pid)
  	if err == findprocess.ErrNotFound {
  		c.state.Finished = time.Now()
  		return nil
  	}
  	if err != nil {
  		logrus.Warnf("failed to find process %d for container %q: %v", c.state.Pid, c.id, err)
  	} else {
  		err = process.Release()
  		if err != nil {
  			logrus.Warnf("failed to release process %d for container %q: %v", c.state.Pid, c.id, err)
  		}
  	}
  
  	if timeout > 0 {
  		if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr,
  			r.path, rootFlag, r.root, "kill", c.id, c.GetStopSignal()); err != nil {
  
  			if err := checkProcessGone(c); err != nil {
  				return fmt.Errorf("failed to stop container %q: %v", c.id, err)
  			}
  		}
  		err = waitContainerStop(ctx, c, time.Duration(timeout)*time.Second, true)
  		if err == nil {
  			return nil
  		}
  		logrus.Warnf("Stop container %q timed out: %v", c.id, err)
  	}
  
  	if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr,
  		r.path, rootFlag, r.root, "kill", c.id, "KILL"); err != nil {
  
  		if err := checkProcessGone(c); err != nil {
  			return fmt.Errorf("failed to stop container %q: %v", c.id, err)
  		}
  	}
  
  	return waitContainerStop(ctx, c, killContainerTimeout, false)
  }
docs: // StopContainer stops a container. Timeout is given in seconds.