diff --git a/src/examples/Stress.cpp b/src/examples/Stress.cpp index 4019b05a..235d563f 100644 --- a/src/examples/Stress.cpp +++ b/src/examples/Stress.cpp @@ -227,4 +227,4 @@ int main(int argc, char **argv) cout << "engine is not supported" << endl; } return 0; -} \ No newline at end of file +} diff --git a/src/lib/tvgTaskScheduler.h b/src/lib/tvgTaskScheduler.h index 73f82802..7b06679f 100644 --- a/src/lib/tvgTaskScheduler.h +++ b/src/lib/tvgTaskScheduler.h @@ -54,11 +54,8 @@ public: { if (!pending) return; - if (TaskScheduler::threads() > 0) { - unique_lock lock(mtx); - while (!ready) cv.wait(lock); - } - + unique_lock lock(mtx); + while (!ready) cv.wait(lock); pending = false; } @@ -70,21 +67,15 @@ private: { run(tid); - if (TaskScheduler::threads() > 0) { - { - lock_guard lock(mtx); - ready = true; - } - cv.notify_one(); - } + lock_guard lock(mtx); + ready = true; + cv.notify_one(); } void prepare() { - if (TaskScheduler::threads() > 0) { - ready = false; - pending = true; - } + ready = false; + pending = true; } friend class TaskSchedulerImpl;