Ticket #989: signal-handler-hack.patch

File signal-handler-hack.patch, 1.4 KB (added by megane, 11 years ago)

a hack that makes the symptoms go away

  • library.scm

    diff --git a/library.scm b/library.scm
    index 31e1e0c..cbe6bf3 100644
    a b EOF 
    44454445
    44464446(define ##sys#signal-vector (make-vector 256 #f))
    44474447
    4448 (define (##sys#interrupt-hook reason state)
    4449   (let loop ((reason reason))
    4450     (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
    4451            (lambda (handler)
    4452              (handler reason)
    4453              (loop (##core#inline "C_i_pending_interrupt" #f))))
    4454           ((fx> (##sys#slot ##sys#pending-finalizers 0) 0)
    4455            (##sys#run-pending-finalizers state) )
    4456           ((procedure? state) (state))
    4457           (else (##sys#context-switch state) ) ) ) )
     4448(define ##sys#interrupt-hook
     4449  (let ((foo #f))
     4450    (lambda (reason state)
     4451      (if foo
     4452          (begin
     4453            (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
     4454                   (lambda (handler)
     4455                     (handler reason))))
     4456            (##sys#context-switch state))
     4457          (begin
     4458            (set! foo #t)
     4459            (let loop ((reason reason))
     4460              (cond ((and reason (##sys#slot ##sys#signal-vector reason)) =>
     4461                     (lambda (handler)
     4462                       (handler reason)
     4463                       (loop (##core#inline "C_i_pending_interrupt" #f))))
     4464                    ((fx> (##sys#slot ##sys#pending-finalizers 0) 0)
     4465                     (##sys#run-pending-finalizers state) )
     4466                    ((procedure? state) (state))
     4467                    (else (##sys#context-switch state) ) ) )
     4468            (set! foo #f))))) )
    44584469
    44594470(define (##sys#dispatch-interrupt k)
    44604471  (##sys#interrupt-hook