Definition at line 148 of file dirCount.cpp.
◆ runnerType()
◆ finish()
static void runnerType::finish |
( |
counterType & |
sumCounter, |
|
|
bool |
verbose |
|
) |
| |
|
inlinestatic |
Definition at line 173 of file dirCount.cpp.
176 for (
auto& runner :
runners()) {
177 runner.worker.join();
178 runner.sum(sumCounter);
181 unsigned int realizedThreads(0);
182 unsigned int unusedThreads(0);
183 for (
auto& runner :
runners()) {
185 if (runner.getDirsDone() == 0) {
189 std::cerr <<
"of " << realizedThreads <<
" threads " << unusedThreads <<
" were not used\n";
References cv, listMutex, nActiveWorkers, runners(), and verbose.
Referenced by main().
◆ getDirsDone()
unsigned int runnerType::getDirsDone |
( |
| ) |
const |
|
inline |
◆ newWorker()
static void runnerType::newWorker |
( |
dirQueueType & |
dirQueue | ) |
|
|
inlinestatic |
◆ process()
Definition at line 201 of file dirCount.cpp.
202 while (
auto path = dirQueue.
dequeue()) {
206 auto result = opendir(path->c_str());
208 if (result ==
nullptr) {
212 }
else if (errno == ENOENT) {
215 }
else if (errno == ENOTDIR) {
224 while (
auto entry = readdir(dir)) {
226 if (entry->d_name[entry->d_name[0] !=
'.' ? 0 : entry->d_name[1] !=
'.' ? 1 : 2] ==
'\0') {
231 if (entry->d_type == DT_DIR) {
232 std::string subdir(*path);
234 subdir += entry->d_name;
238 std::string item(*path);
240 item += entry->d_name;
247 std::unique_lock<decltype(
listMutex)> lock;
References throwcall::badval(), counterType::count(), counter, cv, MyWaitQueues::simple< T >::dequeue(), dirsDone, MyWaitQueues::simple< T >::emplace(), ignoreAccess, listMutex, nActiveWorkers, newWorker(), reportUnknowns, timer::instanceUnscoped::restart(), timer::instanceUnscoped::stop(), unknownList, and unknownListMutex.
Referenced by runnerType().
◆ runners()
static std::forward_list<runnerType>& runnerType::runners |
( |
| ) |
|
|
inlinestatic |
◆ sum()
◆ counter
◆ dirsDone
unsigned int runnerType::dirsDone |
|
private |
◆ worker
std::thread runnerType::worker |
The documentation for this class was generated from the following file:
T badval(T call, t badvalue, const Args &... args)
template function to wrap system calls that return a special bad value on failure