This commit is contained in:
parent
0e8824a8d2
commit
031682051f
@ -50,7 +50,7 @@ auto tasks::task_wait::wait() const -> bool {
|
|||||||
auto tasks::schedule(task item) -> task_ptr {
|
auto tasks::schedule(task item) -> task_ptr {
|
||||||
++count_;
|
++count_;
|
||||||
while (not stop_requested_ && (count_ >= task_threads_.size())) {
|
while (not stop_requested_ && (count_ >= task_threads_.size())) {
|
||||||
std::this_thread::sleep_for(10ms);
|
std::this_thread::sleep_for(50ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduled_task runnable{item};
|
scheduled_task runnable{item};
|
||||||
@ -64,8 +64,6 @@ auto tasks::schedule(task item) -> task_ptr {
|
|||||||
|
|
||||||
tasks_.push_back(runnable);
|
tasks_.push_back(runnable);
|
||||||
notify_.notify_all();
|
notify_.notify_all();
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
return runnable.wait;
|
return runnable.wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user