Squid Web Cache master
Loading...
Searching...
No Matches
Kids Class Reference

a collection of kids More...

#include <Kids.h>

Collaboration diagram for Kids:
[legend]

Public Member Functions

 Kids ()
 
void init ()
 initialize all kid records based on Config
 
Kidfind (pid_t pid)
 returns kid by pid
 
Kidget (size_t i)
 returns the kid by index, useful for kids iteration
 
bool allHopeless () const
 whether all kids are hopeless
 
void forgetAllFailures ()
 forgets all failures in all kids
 
time_t forgetOldFailures ()
 
bool allExitedHappy () const
 whether all kids called exited happy
 
bool someSignaled (const int sgnl) const
 whether some kids died from a given signal
 
bool someRunning () const
 whether some kids are running
 
bool shouldRestartSome () const
 whether some kids should be restarted by master
 
size_t count () const
 returns the number of kids
 

Private Member Functions

 Kids (const Kids &)
 not implemented
 
Kidsoperator= (const Kids &)
 not implemented
 

Private Attributes

std::vector< Kidstorage
 

Detailed Description

Definition at line 17 of file Kids.h.

Constructor & Destructor Documentation

◆ Kids() [1/2]

Kids::Kids ( )

Definition at line 21 of file Kids.cc.

◆ Kids() [2/2]

Kids::Kids ( const Kids )
private

Member Function Documentation

◆ allExitedHappy()

bool Kids::allExitedHappy ( ) const

Definition at line 106 of file Kids.cc.

References storage.

◆ allHopeless()

bool Kids::allHopeless ( ) const

Definition at line 67 of file Kids.cc.

References storage.

Referenced by masterExit().

◆ count()

size_t Kids::count ( ) const

Definition at line 146 of file Kids.cc.

References storage.

Referenced by BroadcastSignalIfAny(), find(), get(), and watch_child().

◆ find()

Kid * Kids::find ( pid_t  pid)

Definition at line 47 of file Kids.cc.

References assert, count(), pid, and storage.

Referenced by watch_child().

◆ forgetAllFailures()

void Kids::forgetAllFailures ( )

Definition at line 77 of file Kids.cc.

References storage.

Referenced by masterReconfigureStart().

◆ forgetOldFailures()

time_t Kids::forgetOldFailures ( )

forgets all failures in hopeless kids that were dead for a long time

Returns
seconds till the next check (zero if there are no hopeless kids left)

Definition at line 84 of file Kids.cc.

References assert, Config, SquidConfig::hopelessKidRevivalDelay, and storage.

Referenced by masterMaintainKidRevivalSchedule().

◆ get()

Kid & Kids::get ( size_t  i)

Definition at line 60 of file Kids.cc.

References assert, count(), and storage.

Referenced by BroadcastSignalIfAny(), and watch_child().

◆ init()

void Kids::init ( )

maintain n kids

Definition at line 26 of file Kids.cc.

References SquidConfig::cacheSwap, SBuf::clear(), Config, Must, Store::DiskConfig::n_strands, NumberOfKids(), storage, and SquidConfig::workers.

Referenced by watch_child().

◆ operator=()

Kids & Kids::operator= ( const Kids )
private

◆ shouldRestartSome()

bool Kids::shouldRestartSome ( ) const

Definition at line 136 of file Kids.cc.

References storage.

Referenced by watch_child().

◆ someRunning()

bool Kids::someRunning ( ) const

Definition at line 126 of file Kids.cc.

References storage.

Referenced by watch_child().

◆ someSignaled()

bool Kids::someSignaled ( const int  sgnl) const

Definition at line 116 of file Kids.cc.

References storage.

Referenced by masterExit().

Member Data Documentation

◆ storage

std::vector<Kid> Kids::storage
private

The documentation for this class was generated from the following files: