mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 06:04:03 +00:00
common taskScheduler: code refactoring
removed unnecessary code.
This commit is contained in:
parent
c2e1583e94
commit
a71773f98d
2 changed files with 8 additions and 17 deletions
|
@ -54,11 +54,8 @@ public:
|
||||||
{
|
{
|
||||||
if (!pending) return;
|
if (!pending) return;
|
||||||
|
|
||||||
if (TaskScheduler::threads() > 0) {
|
|
||||||
unique_lock<mutex> lock(mtx);
|
unique_lock<mutex> lock(mtx);
|
||||||
while (!ready) cv.wait(lock);
|
while (!ready) cv.wait(lock);
|
||||||
}
|
|
||||||
|
|
||||||
pending = false;
|
pending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,22 +67,16 @@ private:
|
||||||
{
|
{
|
||||||
run(tid);
|
run(tid);
|
||||||
|
|
||||||
if (TaskScheduler::threads() > 0) {
|
|
||||||
{
|
|
||||||
lock_guard<mutex> lock(mtx);
|
lock_guard<mutex> lock(mtx);
|
||||||
ready = true;
|
ready = true;
|
||||||
}
|
|
||||||
cv.notify_one();
|
cv.notify_one();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void prepare()
|
void prepare()
|
||||||
{
|
{
|
||||||
if (TaskScheduler::threads() > 0) {
|
|
||||||
ready = false;
|
ready = false;
|
||||||
pending = true;
|
pending = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
friend class TaskSchedulerImpl;
|
friend class TaskSchedulerImpl;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue