Update of /cvsroot/scsh/scsh-0.6/scsh
In directory usw-pr-cvs1:/tmp/cvs-serv12306
Modified Files:
procobj.scm sighandlers.scm utilities.scm
Log Message:
+ Fixed small race condition problem in wait. There are still problems
when lots of processes are forked
+ Added optional name parameter in run-as-long-as
Index: procobj.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/procobj.scm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** procobj.scm 2001/10/18 09:02:52 1.14
--- procobj.scm 2001/11/08 08:14:37 1.15
***************
*** 179,183 ****
(*sigchld-handler*)
(lp next-event))))
! thunk))
;;; This list contains pids whose proc-obj were gc'd before they died
--- 179,184 ----
(*sigchld-handler*)
(lp next-event))))
! thunk
! 'auto-reaping))
;;; This list contains pids whose proc-obj were gc'd before they died
***************
*** 291,298 ****
(release-lock wait-lock)
; we have to block and hence use the event system
! (let lp ((pre-event pre-event))
! (let ((event (next-sigevent pre-event interrupt/chld)))
! (cond ((wait proc (bitwise-ior flags wait/poll)) => win)
! (else (lp event))))))
((eq? wait/poll (bitwise-and flags wait/poll))
--- 292,299 ----
(release-lock wait-lock)
; we have to block and hence use the event system
! (let lp ((pre-event pre-event))
! (cond ((wait proc (bitwise-ior flags wait/poll)) => win)
! (else
! (lp (next-sigevent pre-event interrupt/chld))))))
((eq? wait/poll (bitwise-and flags wait/poll))
Index: sighandlers.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/sighandlers.scm,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** sighandlers.scm 2001/10/18 09:02:52 1.20
--- sighandlers.scm 2001/11/08 08:14:37 1.21
***************
*** 189,193 ****
interrupt)
(enum interrupt keyboard))))))
! (run-as-long-as deliver-interrupts thunk))
(define (deliver-interrupts)
--- 189,193 ----
interrupt)
(enum interrupt keyboard))))))
! (run-as-long-as deliver-interrupts thunk 'deliver-interrupts))
(define (deliver-interrupts)
Index: utilities.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/utilities.scm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** utilities.scm 2001/10/03 14:41:01 1.5
--- utilities.scm 2001/11/08 08:14:37 1.6
***************
*** 274,282 ****
; Don't use unless you know what you are doing
! (define (run-as-long-as thunk1 thunk2)
(let ((thread (make-placeholder)))
! (spawn (lambda ()
! (placeholder-set! thread (current-thread))
! (thunk1)))
(dynamic-wind
(lambda () #t)
--- 274,283 ----
; Don't use unless you know what you are doing
! (define (run-as-long-as thunk1 thunk2 . name)
(let ((thread (make-placeholder)))
! (apply spawn (lambda ()
! (placeholder-set! thread (current-thread))
! (thunk1))
! name)
(dynamic-wind
(lambda () #t)
|