diff options
author | Brett Weiland <brett_weiland@bpcspace.com> | 2023-01-23 17:41:33 -0600 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcspace.com> | 2023-01-23 17:41:33 -0600 |
commit | e6cf67d4ed4ade12c7c830da388194492b07c3e3 (patch) | |
tree | c64f9645d6ac6956bf46f539673bc034ccaedcdf /mthread.cpp | |
parent | 3b97e627caa6883391bd1e9f3c31172e10bf7404 (diff) |
finished mthread polymorphisim, moving onto revamping syncronization
Diffstat (limited to 'mthread.cpp')
-rw-r--r-- | mthread.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mthread.cpp b/mthread.cpp index 4af25ff..89d79bd 100644 --- a/mthread.cpp +++ b/mthread.cpp @@ -90,7 +90,7 @@ bool mthread::find_work() { for(;;) { //find the worker who has the biggest workload worker = distance(loads, max_element(loads, &loads[worker_cnt])); - if(!loads[worker]) break; //we have found a worker; distance is 0 + if(!loads[worker]) return true; //we have found a worker; distance is 0 peer_status = &workers[worker]->status; peer_status->status_lock.lock(); //check to see if canidate is valid. @@ -124,7 +124,7 @@ bool mthread::find_work() { status.status_lock.lock(); status.searching = false; status.status_lock.unlock(); - break; + return true; } return true; } |