From b79df3d6c118d89b6d6029dfaa2c0de3910adb4f Mon Sep 17 00:00:00 2001 From: marting Date: Wed, 28 Jun 2000 10:30:59 +0000 Subject: [PATCH] Opened threads-internal only for access and replaced runn by run again. --- scsh/scsh-interfaces.scm | 10 +++++++--- scsh/scsh-package.scm | 3 ++- scsh/scsh.scm | 4 ++-- scsh/sighandlers.scm | 9 ++++++--- scsh/syntax.scm | 8 ++++---- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/scsh/scsh-interfaces.scm b/scsh/scsh-interfaces.scm index b1b8544..ac5c4b2 100644 --- a/scsh/scsh-interfaces.scm +++ b/scsh/scsh-interfaces.scm @@ -328,8 +328,8 @@ wait/poll wait/stopped-children - sleep - sleep-until + ;sleep + ;sleep-until call-terminally halts?)) @@ -532,7 +532,7 @@ (define-interface scsh-high-level-process-interface - (export (runn :syntax) + (export (run :syntax) (exec-epf :syntax) (& :syntax) (|| :syntax) @@ -1148,3 +1148,7 @@ interrupt/winch interrupt/xcpu interrupt/xfsz)) + +(define-interface locks-interface + (export obtain-lock + release-lock)) \ No newline at end of file diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index 2e3f5ba..1667552 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -192,7 +192,7 @@ channels channel-i/o low-channels byte-vectors - threads threads-internal locks placeholders + threads locks placeholders primitives escapes command-levels @@ -205,6 +205,7 @@ escapes i/o ; S48's force-output formats + threads-internal records ; I don't think this is necessary. !!! scheme) ; For accessing the normal I/O operators. (files syntax diff --git a/scsh/scsh.scm b/scsh/scsh.scm index 19b66bf..d163943 100644 --- a/scsh/scsh.scm +++ b/scsh/scsh.scm @@ -523,7 +523,7 @@ ;; In a subprocess, close the read ports, redirect input from ;; the write ports, and run THUNK. - (status (runn (begin (for-each close-input-port read-ports) + (status (run (begin (for-each close-input-port read-ports) (for-each move->fdes write-ports fds) (thunk))))) @@ -599,7 +599,7 @@ (define (run/file* thunk) (let ((fname (create-temp-file))) - (runn (begin (thunk)) (> ,fname)) + (run (begin (thunk)) (> ,fname)) fname)) (define (run/string* thunk) diff --git a/scsh/sighandlers.scm b/scsh/sighandlers.scm index 9811cc4..7545bfc 100644 --- a/scsh/sighandlers.scm +++ b/scsh/sighandlers.scm @@ -355,9 +355,12 @@ (set-interrupt-handler interrupt/keyboard (lambda stuff - (schedule-event scheduler-initial-thread - (enum event-type interrupt) - (enum interrupt keyboard)))))) + ((structure-ref threads-internal schedule-event) + scheduler-initial-thread + (enum + (structure-ref threads-internal event-type) + interrupt) + (enum interrupt keyboard)))))) ;;; I am ashamed to say the 33 below is completely bogus. ;;; What we want is a value that is 1 + max interrupt value. diff --git a/scsh/syntax.scm b/scsh/syntax.scm index c7c2ea1..8d2e0c5 100644 --- a/scsh/syntax.scm +++ b/scsh/syntax.scm @@ -17,7 +17,7 @@ (define-simple-syntax (& . epf) (fork (lambda () (exec-epf . epf)))) -(define-simple-syntax (runn . epf) +(define-simple-syntax (run . epf) (wait (& . epf))) ;;; Sequencing operators: @@ -32,9 +32,9 @@ ;;; WARNING: || is not a readable symbol in R4RS. -(define-simple-syntax (|| pf ...) (or (zero? (runn pf)) ...)) -(define-simple-syntax (:or: pf ...) (or (zero? (runn pf)) ...)) -(define-simple-syntax (&& pf ...) (and (zero? (runn pf)) ...)) +(define-simple-syntax (|| pf ...) (or (zero? (run pf)) ...)) +(define-simple-syntax (:or: pf ...) (or (zero? (run pf)) ...)) +(define-simple-syntax (&& pf ...) (and (zero? (run pf)) ...)) (define-simple-syntax (run/collecting fds . epf) (run/collecting* `fds (lambda () (exec-epf . epf))))