Anklang-0.3.0.dev967+g08f67ae3 anklang-0.3.0.dev967+g08f67ae3
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Ase::KillPids Struct Referencefinal

Cleanup list of child processes still running at exit. More...

Public Member Functions

void add (pid_t pid)
 
void del (pid_t pid)
 
void collect_children (int sig)
 Find previously orphaned child processes, optionally send signal.
 
void reap ()
 Reap zombies and remove dead PIDs from the list.
 
void kill_all (int sig)
 Send signal sig to all tracked PIDs.
 
void clear ()
 Clear the PID list after both kill phases are complete.
 
bool empty ()
 Return true if no PIDs are tracked.
 

Static Public Member Functions

static std::vector< pid_tread_children ()
 Read orphaned grandchildren reparented to this process as subreaper.
 

Detailed Description

Cleanup list of child processes still running at exit.

Definition at line 124 of file atquit.cc.

Constructor & Destructor Documentation

◆ ~KillPids()

Ase::KillPids::~KillPids ( )

Definition at line 125 of file atquit.cc.

Member Function Documentation

◆ add()

void Ase::KillPids::add ( pid_t  pid)

Definition at line 130 of file atquit.cc.

◆ clear()

void Ase::KillPids::clear ( )

Clear the PID list after both kill phases are complete.

Definition at line 181 of file atquit.cc.

References std::vector::clear().

◆ collect_children()

void Ase::KillPids::collect_children ( int  sig)

Find previously orphaned child processes, optionally send signal.

Definition at line 143 of file atquit.cc.

References std::vector::begin(), std::vector::end(), std::find(), kill(), pid_t, std::vector::push_back(), and read_children().

◆ del()

void Ase::KillPids::del ( pid_t  pid)

Definition at line 136 of file atquit.cc.

◆ empty()

bool Ase::KillPids::empty ( )

Return true if no PIDs are tracked.

Definition at line 188 of file atquit.cc.

References std::vector::empty().

◆ kill_all()

void Ase::KillPids::kill_all ( int  sig)

Send signal sig to all tracked PIDs.

Does NOT clear the list, so the same PIDs can be targeted again with an escalated signal.

Definition at line 171 of file atquit.cc.

References kill(), and pid_t.

◆ read_children()

static std::vector< pid_t > Ase::KillPids::read_children ( )
static

Read orphaned grandchildren reparented to this process as subreaper.

Definition at line 195 of file atquit.cc.

References fclose(), fopen(), fscanf(), getpid(), pid_t, and snprintf().

Referenced by collect_children().

◆ reap()

void Ase::KillPids::reap ( )

Reap zombies and remove dead PIDs from the list.

Definition at line 159 of file atquit.cc.

References Ase::Aux::erase_first(), pid_t, and waitpid().


The documentation for this struct was generated from the following file: