4 (sb-ext:schedule-timer
*timer
* 60))
7 (logger "Starting...~%")
10 (setq *timer
* (sb-ext:make-timer
'julia
::timer-fn
)
11 *cache
* (make-hash-table))
17 (send-msg :all
'hello
))
24 (logger "Saving core...~%")
29 ;; Wait for previous dump to finish (if it is still running)
30 (when (plusp *save-pid
*)
31 (sb-posix:waitpid
*save-pid
* 0)
34 (setq *save-pid
* (sb-posix:fork
))
37 (setq *poll-in
* nil
) ; pollitem is a bad guy
38 (sb-ext:gc
:full t
) ; run finalizers
39 (sb-ext:save-lisp-and-die
(concatenate 'string
"CORE-" *me
*)
40 :toplevel
#'julia
::julia
))
42 (error "fork failed~%"))))
45 (when (< *last-gen
* *gen
*)
50 (when (safe-eval args
) ; don't trash log
51 (push (cons *gen
* args
) *feeds
*)
52 (setq *cache
* (make-hash-table))
55 (defun dispatch (cmd from to uid args
)
56 (let ((f (intern (concatenate 'string
"DISPATCH-" (string-upcase cmd
)))))
58 (funcall f from to uid args
)
73 (multiple-value-bind (to from uid cmd args
)
75 (when (string/= from
*me
*)
76 (dispatch cmd from to uid args
)))))
77 (error (c) (logger "BUG: ~a~%" c
)))