From 2cdd26901ebdb2622449d8065283562a963ea6e4 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 15 Jul 2009 19:41:44 +0000 Subject: [PATCH] yield thread for each task, and even when there are no tasks --- panda/src/event/asyncTaskChain.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/event/asyncTaskChain.cxx b/panda/src/event/asyncTaskChain.cxx index c4424ef297..1657f27f6d 100644 --- a/panda/src/event/asyncTaskChain.cxx +++ b/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; }