]> git.lizzy.rs Git - rust.git/commit
std: Support consuming a Process without waiting
authorAlex Crichton <alex@alexcrichton.com>
Sat, 31 May 2014 00:18:12 +0000 (17:18 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 16 Jun 2014 17:47:25 +0000 (10:47 -0700)
commit2fe926431bb198a052a5eae92ff820a4f572fd92
treeec39df7109eee720e694224a0929605443a46b96
parent0b32d42a5da84c1f23a2b50b9a6741eea69773c4
std: Support consuming a Process without waiting

Forking off a child which survives the parent is often a useful task, and is
currently not possible because the Process type will invoke `wait()` in its
destructor in order to prevent leaking resources. This function adds a new safe
method, `forget`, which can be used to consume an instance of `Process` which
will then not call `wait` in the destructor.

This new method is clearly documented as a leak of resources, but it must be
forcibly opted in to.

Closes #14467
src/libstd/io/process.rs