Browse Source

yield at least every frame in the SIMPLE_THREADS case

David Rose 18 years ago
parent
commit
ad2d5e3ba7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      panda/src/display/graphicsEngine.cxx

+ 4 - 1
panda/src/display/graphicsEngine.cxx

@@ -800,11 +800,14 @@ render_frame() {
   // wait for those threads before we can flip.
   // wait for those threads before we can flip.
   _flip_state = _auto_flip ? FS_flip : FS_draw;
   _flip_state = _auto_flip ? FS_flip : FS_draw;
 
 
-  if (yield_timeslice) { 
+  if (yield_timeslice) {
     // Nap for a moment to yield the timeslice, to be polite to other
     // Nap for a moment to yield the timeslice, to be polite to other
     // running applications.
     // running applications.
     PStatTimer timer(_yield_pcollector, current_thread);
     PStatTimer timer(_yield_pcollector, current_thread);
     Thread::force_yield();
     Thread::force_yield();
+  } else if (!Thread::is_true_threads()) { 
+    PStatTimer timer(_yield_pcollector, current_thread);
+    Thread::consider_yield();
   }
   }
 
 
   // Anything that happens outside of GraphicsEngine::render_frame()
   // Anything that happens outside of GraphicsEngine::render_frame()