prepare for threaded rendering?

one chip per thread.
This commit is contained in:
tildearrow 2023-09-06 04:03:53 -05:00
parent ec4063641a
commit 7d0f816d11
3 changed files with 29 additions and 9 deletions

View file

@ -50,7 +50,9 @@ void DivWorkThread::run() {
task.func(task.funcArg);
parent->busyCount--;
if (--parent->busyCount<0) {
logE("oh no PROBLEM...");
}
parent->notify.notify_one();
}
}
@ -125,8 +127,8 @@ void DivWorkPool::wait() {
}
// wait
while (busyCount!=0) {
if (notify.wait_for(unique,std::chrono::milliseconds(100))==std::cv_status::timeout) {
while (busyCount>0) {
if (notify.wait_for(unique,std::chrono::milliseconds(30))==std::cv_status::timeout) {
logW("DivWorkPool: wait() timed out!");
}
}