/[slime]/slime/swank-clisp.lisp
ViewVC logotype

Diff of /slime/swank-clisp.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by heller, Tue Jan 13 19:27:24 2004 UTC revision 1.10 by wjenkner, Wed Jan 14 23:43:16 2004 UTC
# Line 24  Line 24 
24    (use-package "SOCKET")    (use-package "SOCKET")
25    (use-package "GRAY"))    (use-package "GRAY"))
26    
27  (setq *use-dedicated-output-stream* nil)  (eval-when (:compile-toplevel :execute)
28  ;(setq *redirect-output* nil)    (when (find-package "LINUX")
29        (pushnew :linux *features*)))
30    
31  #+linux  #+linux
32    (defmacro with-blocked-signals ((&rest signals) &body body)
33      (ext:with-gensyms ("SIGPROCMASK" ret mask)
34        `(multiple-value-bind (,ret ,mask)
35             (linux:sigprocmask-set-n-save
36              ,linux:SIG_BLOCK
37              ,(do ((sigset (linux:sigset-empty)
38                            (linux:sigset-add sigset (the fixnum (pop signals)))))
39                   ((null signals) sigset)))
40           (linux:check-res ,ret 'linux:sigprocmask-set-n-save)
41           (unwind-protect
42                (progn ,@body)
43             (linux:sigprocmask-set ,linux:SIG_SETMASK ,mask nil)))))
44    
45    #+linux
46  (defmacro without-interrupts (&body body)  (defmacro without-interrupts (&body body)
47    `(let ((sigact (linux:signal-action-retrieve linux:SIGINT)))    `(with-blocked-signals (,linux:SIGINT) ,@body))
      (unwind-protect  
           (progn  
             (linux:set-sigprocmask linux:SIG_BLOCK (linux:sa-mask sigact))  
             ,@body)  
        (linux:set-sigprocmask linux:SIG_UNBLOCK (linux:sa-mask sigact)))))  
48    
49  #-linux  #-linux
50  (defmacro without-interrupts (body)  (defmacro without-interrupts (&body body)
51    body)    `(progn ,@body))
52    
53  (defun without-interrupts* (fun)  (defun without-interrupts* (fun)
54    (without-interrupts (funcall fun)))    (without-interrupts (funcall fun)))

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.5