Move maybe-signal-io-thread-events apply out of yield-thread.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 19 Oct 2012 18:56:20 +0000 (11:56 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 19 Oct 2012 18:56:20 +0000 (11:56 -0700)
Moved the call to yield-current-thread.  It is otherwise redundant
with all the i/o and timer event polling in thread-timer-interrupt-
handler, the other caller of yield-thread.

src/runtime/thread.scm

index 2a99f9e04bc804ee15eb25fccfe5917f497033aa..cf637aec16bf11ee98cf09ca5b031a4a6f59c51a 100644 (file)
@@ -334,6 +334,7 @@ USA.
 (define (yield-current-thread)
   (without-interrupts
    (lambda ()
+     (maybe-signal-io-thread-events)
      (call-with-current-thread #t
        (lambda (thread)
         ;; Allow preemption now, since the current thread has
@@ -342,7 +343,6 @@ USA.
         (yield-thread thread))))))
 
 (define (yield-thread thread #!optional fp-env)
-  (maybe-signal-io-thread-events)
   (let ((next (thread/next thread)))
     (%trace ";yield-thread: "thread" yields to "next"\n")
     (if (not next)