Skip to content

process detach

Alairion edited this page May 8, 2021 · 6 revisions

nes::process::detach

Functions

(1) void detach();
  1. Permits the process to run independently from the process object. After a call to detach, the process object no longer represents a valid process.

Note: on Posix systems, if the parent process ends before the detached child, the child becomes an orphan process. If the parent process ends after the detached child, the child becomes a zombie process until the parent ends.

Parameters

None.

Return value

  1. None.

Preconditions

  1. joinable() returns true.

Postconditions

  1. joinable() returns false.

Exceptions

  1. May throw a std::runtime_error if the process can not be detached.

Implementation details

  1. On Windows, closes the handles
    On Posix systems, just "forget" the child's id.

Clone this wiki locally