From e6cf67d4ed4ade12c7c830da388194492b07c3e3 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Mon, 23 Jan 2023 17:41:33 -0600 Subject: finished mthread polymorphisim, moving onto revamping syncronization --- mthread.cpp | 4 ++-- 1 file 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; } -- cgit v1.2.3