diff --git a/.cirrus.yml b/.cirrus.yml index fac5b4a34da..7d7c3adfd32 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ freebsd_instance: image: freebsd-12-3-release-amd64 env: RUST_STABLE: stable - RUST_NIGHTLY: nightly-2022-03-21 + RUST_NIGHTLY: nightly-2022-10-25 RUSTFLAGS: -D warnings # Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index e5ee5db2ba0..2e2507e7792 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -690,6 +690,36 @@ impl Command { self } + /// Sets the process group ID (PGID) of the child process. Equivalent to a + /// setpgid call in the child process, but may be more efficient. + /// + /// Process groups determine which processes receive signals. + /// + /// **Note**: This is an [unstable API][unstable] but will be stabilised once + /// tokio's MSRV is sufficiently new. See [the documentation on + /// unstable features][unstable] for details about using unstable features. + /// + /// If you want similar behaviour without using this unstable feature you can + /// create a [`std::process::Command`] and convert that into a + /// [`tokio::process::Command`] using the `From` trait. + /// + /// [unstable]: crate#unstable-features + /// [`tokio::process::Command`]: crate::process::Command + /// + /// ```no_run + /// use tokio::process::Command; + /// + /// let command = Command::new("ls") + /// .process_group(0); + /// ``` + #[cfg(unix)] + #[cfg(tokio_unstable)] + #[cfg_attr(docsrs, doc(cfg(all(unix, tokio_unstable))))] + pub fn process_group(&mut self, pgroup: i32) -> &mut Command { + self.std.process_group(pgroup); + self + } + /// Executes the command as a child process, returning a handle to it. /// /// By default, stdin, stdout and stderr are inherited from the parent. diff --git a/tokio/src/runtime/task/mod.rs b/tokio/src/runtime/task/mod.rs index 022d6523405..3d5b1cbf373 100644 --- a/tokio/src/runtime/task/mod.rs +++ b/tokio/src/runtime/task/mod.rs @@ -121,7 +121,7 @@ //! 1. The output is created on the thread that the future was polled on. Since //! only non-Send futures can have non-Send output, the future was polled on //! the thread that the future was spawned from. -//! 2. Since JoinHandle is not Send if Output is not Send, the +//! 2. Since `JoinHandle` is not Send if Output is not Send, the //! JoinHandle is also on the thread that the future was spawned from. //! 3. Thus, the JoinHandle will not move the output across threads when it //! takes or drops the output.