>From 37b5c532c23cbbd05c97ba3eed4bbd548a423e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20F=2E=20Wittenberger?= Date: Mon, 15 Feb 2016 12:33:53 +0100 Subject: [PATCH] Remove ##sys#force-primordial --- scheduler.scm | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/scheduler.scm b/scheduler.scm index 8c0976c..17a7318 100644 --- a/scheduler.scm +++ b/scheduler.scm @@ -30,7 +30,7 @@ (disable-interrupts) (hide ready-queue-head ready-queue-tail ##sys#timeout-list ##sys#update-thread-state-buffer ##sys#restore-thread-state-buffer - remove-from-ready-queue ##sys#unblock-threads-for-i/o ##sys#force-primordial + remove-from-ready-queue ##sys#unblock-threads-for-i/o fdset-set fdset-test create-fdset stderr ##sys#clear-i/o-state-for-thread! ##sys#abandon-mutexes) (not inline ##sys#interrupt-hook) @@ -158,7 +158,6 @@ EOF (##core#inline "C_set_initial_timer_interrupt_period" (##sys#slot thread 9)) ((##sys#slot thread 1)) ) (let* ([ct ##sys#current-thread] - [eintr #f] [cts (##sys#slot ct 3)] ) (dbg "==================== scheduling, current: " ct ", ready: " ready-queue-head) (##sys#update-thread-state-buffer ct) @@ -193,20 +192,15 @@ EOF (null? ##sys#fd-list) (pair? ##sys#timeout-list)) (let ((tmo1 (caar ##sys#timeout-list))) - (set! eintr - (and (not (##core#inline - "C_msleep" - (fxmax - 0 - (##core#inline "C_quickflonumtruncate" (fp- tmo1 now))))) - (foreign-value - "C_signal_interrupted_p" bool) ) ) ) ) ) ) + (##core#inline + "C_msleep" + (fxmax + 0 + (##core#inline "C_quickflonumtruncate" (fp- tmo1 now)))) ) ) ) ) (loop (cdr lst)) ) ) ) ) ) ) ;; Unblock threads blocked by I/O: - (if eintr - (##sys#force-primordial) ; force it to handle user-interrupt - (unless (null? ##sys#fd-list) - (##sys#unblock-threads-for-i/o) ) ) + (unless (null? ##sys#fd-list) + (##sys#unblock-threads-for-i/o) ) ;; Fetch and activate next ready thread: (let loop2 () (let ([nt (remove-from-ready-queue)]) @@ -217,11 +211,6 @@ EOF [(eq? (##sys#slot nt 3) 'ready) (switch nt)] [else (loop2)] ) ) ) ) ) ) -(define (##sys#force-primordial) - (dbg "primordial thread forced due to interrupt") - (##sys#setislot ##sys#primordial-thread 13 #f) - (##sys#thread-unblock! ##sys#primordial-thread) ) - (define ready-queue-head '()) (define ready-queue-tail '()) @@ -453,8 +442,7 @@ EOF (or rq? to?) tmo))) (dbg n " fds ready") (cond [(eq? -1 n) - (dbg "select(2)/poll(2) returned with result -1" ) - (##sys#force-primordial)] + (dbg "select(2)/poll(2) returned with result -1" )] [(fx> n 0) (set! ##sys#fd-list (let loop ((n n) (pos 0) (lst ##sys#fd-list)) -- 2.6.2