Browse Source

yield thread for each task, and even when there are no tasks

David Rose 16 years ago
parent
commit
2cdd26901e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      panda/src/event/asyncTaskChain.cxx

+ 2 - 0
panda/src/event/asyncTaskChain.cxx

@@ -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;
   }