Merge pull request #451 from lanurmi/childs-children
Fix plural of "child" -- it is not "childs" but "children".
This commit is contained in:
commit
561f555a70
|
@ -141,12 +141,12 @@ int ThreadExecutor::handleRead(int rpipe, unsigned int &result)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThreadExecutor::checkLoadAverage(size_t nchilds)
|
bool ThreadExecutor::checkLoadAverage(size_t nchildren)
|
||||||
{
|
{
|
||||||
#ifdef __CYGWIN__ // getloadavg() is unsupported on Cygwin.
|
#ifdef __CYGWIN__ // getloadavg() is unsupported on Cygwin.
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
if (!nchilds || !_settings._loadAverage) {
|
if (!nchildren || !_settings._loadAverage) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@ unsigned int ThreadExecutor::check()
|
||||||
std::map<std::string, std::size_t>::const_iterator i = _files.begin();
|
std::map<std::string, std::size_t>::const_iterator i = _files.begin();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Start a new child
|
// Start a new child
|
||||||
size_t nchilds = rpipes.size();
|
size_t nchildren = rpipes.size();
|
||||||
if (i != _files.end() && nchilds < _settings._jobs && checkLoadAverage(nchilds)) {
|
if (i != _files.end() && nchildren < _settings._jobs && checkLoadAverage(nchildren)) {
|
||||||
int pipes[2];
|
int pipes[2];
|
||||||
if (pipe(pipes) == -1) {
|
if (pipe(pipes) == -1) {
|
||||||
std::cerr << "pipe() failed: "<< std::strerror(errno) << std::endl;
|
std::cerr << "pipe() failed: "<< std::strerror(errno) << std::endl;
|
||||||
|
|
|
@ -89,10 +89,10 @@ private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check load average condition
|
* @brief Check load average condition
|
||||||
* @param nchilds - count of currently runned childs
|
* @param nchildren - count of currently runned children
|
||||||
* @return true - if new process can be started
|
* @return true - if new process can be started
|
||||||
*/
|
*/
|
||||||
bool checkLoadAverage(size_t nchilds);
|
bool checkLoadAverage(size_t nchildren);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue