mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
yield thread for each task, and even when there are no tasks
This commit is contained in:
parent
a088d7ff72
commit
2cdd26901e
@ -805,6 +805,7 @@ service_one_task(AsyncTaskChain::AsyncTaskChainThread *thread) {
|
||||
<< *Thread::get_current_thread() << "\n";
|
||||
}
|
||||
}
|
||||
thread_consider_yield();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -1209,6 +1210,7 @@ do_get_sleeping_tasks() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AsyncTaskChain::
|
||||
do_poll() {
|
||||
thread_consider_yield();
|
||||
if (_num_tasks == 0) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user