Skip to content

Commit

Permalink
core-foundation.run-loop: remove unnecessary yields. This fixes a thr…
Browse files Browse the repository at this point in the history
…ead starvation issue with game.input
  • Loading branch information
Slava Pestov committed Mar 15, 2010
1 parent 8df0965 commit d07a2bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions basis/core-foundation/run-loop/run-loop.factor
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ TUPLE: run-loop fds sources timers ;
nano-count - 1,000 /f system-micros + ;

: reset-timer ( timer -- )
yield {
{ [ run-queue deque-empty? not ] [ yield system-micros (reset-timer) ] }
{ [ sleep-queue heap-empty? ] [ system-micros 1,000,000 + (reset-timer) ] }
[ sleep-queue heap-peek nip nano-count>micros (reset-timer) ]
} cond ;
{
{ [ run-queue deque-empty? not ] [ system-micros ] }
{ [ sleep-queue heap-empty? not ] [ sleep-queue heap-peek nip nano-count>micros ] }
[ system-micros 1,000,000 + ]
} cond (reset-timer) ;

PRIVATE>

Expand Down

0 comments on commit d07a2bd

Please sign in to comment.