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

Diff of /slime/swank-backend.lisp

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

revision 1.97 by dcrosher, Wed Mar 22 16:40:01 2006 UTC revision 1.98 by nsiivola, Wed Apr 12 08:43:55 2006 UTC
# Line 836  Only one thread may hold the lock (via C Line 836  Only one thread may hold the lock (via C
836              (type function function))              (type function function))
837     (funcall function))     (funcall function))
838    
839    (definterface make-recursive-lock (&key name)
840      "Make a lock for thread synchronization.
841    Only one thread may hold the lock (via CALL-WITH-RECURSIVE-LOCK-HELD)
842    at a time, but that thread may hold it more than once."
843      (cons nil (make-lock :name name)))
844    
845    (definterface call-with-recursive-lock-held (lock function)
846      "Call FUNCTION with LOCK held, queueing if necessary."
847      (if (eql (car lock) (current-thread))
848          (funcall function)
849          (call-with-lock-held (cdr lock)
850                               (lambda ()
851                                 (unwind-protect
852                                      (progn
853                                        (setf (car lock) (current-thread))
854                                        (funcall function))
855                                   (setf (car lock) nil))))))
856    
857  (definterface current-thread ()  (definterface current-thread ()
858    "Return the currently executing thread."    "Return the currently executing thread."
859    0)    0)

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.98

  ViewVC Help
Powered by ViewVC 1.1.5