File: init.scm

package info (click to toggle)
scsh-0.6 0.6.7-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 15,124 kB
  • ctags: 16,788
  • sloc: lisp: 82,839; ansic: 23,112; sh: 3,116; makefile: 829
file content (41 lines) | stat: -rw-r--r-- 1,323 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
; Copyright (c) 1993-1999 by Richard Kelsey and Jonathan Rees. See file COPYING.

; System entry and exit

; Entry point from OS executive.  Procedures returned by USUAL-RESUMER
; are suitable for use as the second argument to WRITE-IMAGE.
;
; The placement of INITIALIZE-RECORDS! is questionable.  Important parts
; of the system are not in place when it is run.

(define (usual-resumer entry-point)
  (lambda (resume-arg in out error records)
    (initialize-rts in out error
     (lambda ()
       (initialize-records! records)
       (with-sigevents
	(lambda ()
	  (entry-point (vector->list resume-arg))))))))
       
(define (initialize-rts in out error thunk)
  (initialize-session-data!)
  (initialize-dynamic-state!)
  (initialize-output-port-list!)
  (initialize-exceptions! current-error-port write-string
    (lambda ()
      (initialize-interrupts!
       spawn-on-root
       (lambda ()
	 (initialize-i/o (input-channel->port in)
			 (output-channel->port out)
	                 (output-channel->port error 0)  ; zero-length buffer
	     (lambda ()
	       (with-threads
		(lambda ()
		  (root-scheduler thunk
				  200           ; thread quantum, in msec
				  300)))))))))) ; port-flushing quantum

; Add the full/empty buffer handlers.

(initialize-i/o-handlers! define-exception-handler signal-exception)