[io,doc]: Point out that exit does not kill child processes.

Bug:https://github.com/dart-lang/sdk/issues/53772
Change-Id: I38d18e97036b5684982a78f44f03634c5b3dceea
CoreLibraryReviewExempt: documentation only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370320
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
Brian Quinlan 2024-06-10 22:58:28 +00:00 committed by Commit Queue
parent 6ab01427bd
commit 33563e5cf9

View file

@ -20,6 +20,9 @@ class _ProcessUtils {
/// This does not wait for any asynchronous operations to terminate nor execute
/// `finally` blocks. Using [exit] is therefore very likely to lose data.
///
/// Child processes are not explicitly terminated (but they may terminate
/// themselves when they detect that their parent has exited).
///
/// While debugging, the VM will not respect the `--pause-isolates-on-exit`
/// flag if [exit] is called as invoking this method causes the Dart VM
/// process to shutdown immediately. To properly break on exit, consider
@ -347,7 +350,10 @@ abstract interface class Process {
/// ```
/// If [mode] is [ProcessStartMode.normal] (the default) a child
/// process will be started with `stdin`, `stdout` and `stderr`
/// connected.
/// connected to its parent. The parent process will not exit so long as the
/// child is running, unless [exit] is called by the parent. If [exit] is
/// called by the parent then the parent will be terminated but the child
/// will continue running.
///
/// If `mode` is [ProcessStartMode.detached] a detached process will
/// be created. A detached process has no connection to its parent,
@ -360,8 +366,8 @@ abstract interface class Process {
/// process will be created where the `stdin`, `stdout` and `stderr`
/// are connected. The creator can communicate with the child through
/// these. The detached process will keep running even if these
/// communication channels are closed. The process' exit code will
/// not become available when it terminated.
/// communication channels are closed or the parent dies. The process'
/// exit code will not become available when it terminated.
///
/// The default value for `mode` is `ProcessStartMode.normal`.
external static Future<Process> start(