Changeset View
Changeset View
Standalone View
Standalone View
src/checkqueue.h
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | bool Loop(bool fMaster = false) { | ||||
nTotal++; | nTotal++; | ||||
} | } | ||||
// logically, the do loop starts here | // logically, the do loop starts here | ||||
while (queue.empty()) { | while (queue.empty()) { | ||||
if (fMaster && nTodo == 0) { | if (fMaster && nTodo == 0) { | ||||
nTotal--; | nTotal--; | ||||
bool fRet = fAllOk; | bool fRet = fAllOk; | ||||
// reset the status for new work later | // reset the status for new work later | ||||
if (fMaster) { | |||||
fAllOk = true; | fAllOk = true; | ||||
} | |||||
// return the current status | // return the current status | ||||
return fRet; | return fRet; | ||||
} | } | ||||
nIdle++; | nIdle++; | ||||
cond.wait(lock); // wait | cond.wait(lock); // wait | ||||
nIdle--; | nIdle--; | ||||
} | } | ||||
// Decide how many work units to process now. | // Decide how many work units to process now. | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |