changelog shortlog graph tags branches changeset files file revisions raw help

Mercurial > core / annotate lisp/std/thread.lisp

changeset 664: 4d8451fe5423
parent: da17bf652e48
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 22 Sep 2024 01:02:49 -0400
permissions: -rw-r--r--
description: moved web to lib/web, added dat/css
5
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
1
 ;;; threads.lisp --- Multi-thread utilities
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
2
 
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
3
 ;; Threading Macros
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
4
 
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
5
 ;;; Commentary:
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
6
 
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
7
 ;; mostly yoinked from sb-thread and friends
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
8
 
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
9
 ;;; Code:
291
a0dfde3cb3c4 begin :STD refactor
Richard Westhaver <ellis@rwest.io>
parents: 290
diff changeset
10
 (in-package :std/thread)
5
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
11
 
261
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
12
 ;; (sb-thread:thread-os-tid sb-thread:*current-thread*)
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
13
 ;; sb-thread:interrupt-thread
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
14
 
664
4d8451fe5423 moved web to lib/web, added dat/css
Richard Westhaver <ellis@rwest.io>
parents: 514
diff changeset
15
 ;;; Conditions
4d8451fe5423 moved web to lib/web, added dat/css
Richard Westhaver <ellis@rwest.io>
parents: 514
diff changeset
16
 (define-condition std-thread-error (thread-error) ())
4d8451fe5423 moved web to lib/web, added dat/css
Richard Westhaver <ellis@rwest.io>
parents: 514
diff changeset
17
 
492
dc0cc9c69789 ephemeral worker threads
Richard Westhaver <ellis@rwest.io>
parents: 454
diff changeset
18
 ;;; Utils
5
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
19
 (defun thread-support-p () (member :thread-support *features*))
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
20
 
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
21
 (eval-when (:compile-toplevel)
492
dc0cc9c69789 ephemeral worker threads
Richard Westhaver <ellis@rwest.io>
parents: 454
diff changeset
22
   (defun print-top-level (msg)
5
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
23
     (sb-thread:make-thread
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
24
      (lambda ()
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
25
        (format #.*standard-output* msg)))
6ce26a70a11e init std
ellis <ellis@rwest.io>
parents:
diff changeset
26
     nil))
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
27
 
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
28
 (defun find-thread-by-id (id)
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
29
   "Search for thread by ID which must be an u64. On success returns the thread itself or nil."
437
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
30
   (find id (sb-thread::list-all-threads) :test '= :key 'thread-os-tid))
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
31
 
454
8c8786d9b14f find-thread
Richard Westhaver <ellis@rwest.io>
parents: 448
diff changeset
32
 (defun find-thread (name)
8c8786d9b14f find-thread
Richard Westhaver <ellis@rwest.io>
parents: 448
diff changeset
33
   "Find a thread by name."
8c8786d9b14f find-thread
Richard Westhaver <ellis@rwest.io>
parents: 448
diff changeset
34
   (find name (sb-thread::list-all-threads) :test 'equal :key 'thread-name))
8c8786d9b14f find-thread
Richard Westhaver <ellis@rwest.io>
parents: 448
diff changeset
35
 
437
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
36
 (defun thread-key-list ()
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
37
   (sb-thread::avltree-filter #'sb-thread::avlnode-key sb-thread::*all-threads*))
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
38
 
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
39
 (defun thread-id-list ()
437
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
40
   (sb-thread::avltree-filter (lambda (th) (thread-os-tid (sb-thread::avlnode-data th))) sb-thread::*all-threads*))
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
41
 
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
42
 (defun thread-count ()
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
43
   (sb-thread::avl-count sb-thread::*all-threads*))
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
44
 
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
45
 (defun make-threads (n fn &key (name "thread"))
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
46
   (declare (type fixnum n))
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
47
   (loop for i below n
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
48
         collect (make-thread fn :name (format nil "~A-~D" name i))))
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
49
 
437
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
50
 (defun parse-lambda-list-names (ll)
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
51
   (multiple-value-bind (idx _ args) (sb-int:parse-lambda-list ll)
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
52
     (declare (ignore idx _))
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
53
     (loop for a in args
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
54
           collect
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
55
              (etypecase a
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
56
                (atom a)
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
57
                (cons (car a))))))
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
58
 
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
59
 (defmacro with-threads ((n &key args) &body body)
83f8623a6ec3 std work, renamed :disabled in deftest to :skip
Richard Westhaver <ellis@rwest.io>
parents: 336
diff changeset
60
   `(make-threads ,n (lambda (,@args) (declare (ignorable ,@(parse-lambda-list-names args))) ,@body)))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
61
 
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
62
 (defun finish-threads (&rest threads)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
63
   (let ((threads (flatten threads)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
64
     (unwind-protect
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
65
          (mapc #'join-thread threads)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
66
       (dolist (thread threads)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
67
         (when (thread-alive-p thread)
182
0e972410eb3e nu invasion
Richard Westhaver <ellis@rwest.io>
parents: 162
diff changeset
68
           (terminate-thread thread))))))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
69
 
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
70
 (defun timed-join-thread (thread timeout)
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
71
   (declare (type thread thread) (type float timeout))
118
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
72
   (handler-case (sb-sys:with-deadline (:seconds timeout)
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
73
                   (join-thread thread :default :aborted))
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
74
     (sb-ext:timeout ()
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
75
       :timeout)))
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
76
 
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
77
 (defun hang ()
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
78
   (join-thread *current-thread*))
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
79
 
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
80
 (defun kill-thread (thread)
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
81
   (when (thread-alive-p thread)
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
82
     (ignore-errors
b828a3caa758 object library stuff, removed DOT - api doesnt jive.
ellis <ellis@rwest.io>
parents: 96
diff changeset
83
       (terminate-thread thread))))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
84
 
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
85
 ;; (sb-vm::primitive-object-slots (sb-vm::primitive-object 'sb-vm::thread))
261
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
86
 (defun init-session (&optional (thread *current-thread*)) (sb-thread::new-session thread))
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
87
 
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
88
 ;; (sb-thread::with-progressive-timeout (timet :seconds 4) (dotimes (i 4000) (print (timet))))
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
89
 
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
90
 ;; (describe sb-thread::*session*)
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
91
 
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
92
 ;; make-listener-thread 
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
93
 
2a4f11c0e8c8 slint integrated
Richard Westhaver <ellis@rwest.io>
parents: 227
diff changeset
94
 ;; with-progressive-timeout
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
95
 
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
96
 ;; from sb-thread
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
97
 (defun dump-thread ()
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
98
   (let* ((slots (sb-vm::primitive-object-slots #1=(sb-vm::primitive-object 'sb-vm::thread)))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
99
          (sap (current-thread-sap))
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
100
          (thread-obj-len (sb-vm::primitive-object-length #1#))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
101
          (names (make-array thread-obj-len :initial-element "")))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
102
     (loop for slot across slots
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
103
           do
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
104
           (setf (aref names (sb-vm::slot-offset slot)) (sb-vm::slot-name slot)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
105
     (flet ((safely-read (sap offset &aux (bits (sb-vm::sap-ref-word sap offset)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
106
              (cond ((eql bits sb-vm:no-tls-value-marker) :no-tls-value)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
107
                    ((eql (logand bits sb-vm:widetag-mask) sb-vm:unbound-marker-widetag) :unbound)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
108
                    (t (sb-vm::sap-ref-lispobj sap offset))))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
109
            (show (sym val)
227
Richard Westhaver <ellis@rwest.io>
parents: 222
diff changeset
110
              (declare (type fixnum sym))
119
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
111
              (let ((*print-right-margin* 128)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
112
                    (*print-lines* 4))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
113
                (format t " ~3d ~30a : ~s~%"
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
114
                        #+sb-thread (ash sym (- sb-vm:word-shift))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
115
                        #-sb-thread 0
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
116
                        #+sb-thread (sb-vm:symbol-from-tls-index sym)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
117
                        #-sb-thread sym
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
118
                        val))))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
119
       (format t "~&TLS: (base=~x)~%" (sb-vm::sap-int sap))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
120
       (loop for tlsindex from sb-vm:n-word-bytes below
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
121
             #+sb-thread (ash sb-vm::*free-tls-index* sb-vm:n-fixnum-tag-bits)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
122
             #-sb-thread (ash thread-obj-len sb-vm:word-shift)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
123
             by sb-vm:n-word-bytes
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
124
             do
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
125
          (unless (<= sb-vm::thread-allocator-histogram-slot
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
126
                      (ash tlsindex (- sb-vm:word-shift))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
127
                      (1- sb-vm::thread-lisp-thread-slot))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
128
            (let ((thread-slot-name
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
129
                   (if (< tlsindex (ash thread-obj-len sb-vm:word-shift))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
130
                            (aref names (ash tlsindex (- sb-vm:word-shift))))))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
131
                  (if (and thread-slot-name (sb-vm::neq thread-slot-name 'sb-vm::lisp-thread))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
132
                      (format t " ~3d ~30a : #x~x~%" (ash tlsindex (- sb-vm:word-shift))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
133
                              thread-slot-name (sb-vm::sap-ref-word sap tlsindex))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
134
                      (let ((val (safely-read sap tlsindex)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
135
                        (unless (eq val :no-tls-value)
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
136
                          (show tlsindex val)))))))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
137
       (let ((from (sb-vm::descriptor-sap sb-vm:*binding-stack-start*))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
138
             (to (sb-vm::binding-stack-pointer-sap)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
139
         (format t "~%Binding stack: (depth ~d)~%"
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
140
                 (/ (sb-vm::sap- to from) (* sb-vm:binding-size sb-vm:n-word-bytes)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
141
         (loop
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
142
           (when (sb-vm::sap>= from to) (return))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
143
           (let ((val (safely-read from 0))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
144
                 (sym #+sb-thread (sb-vm::sap-ref-word from sb-vm:n-word-bytes) ; a TLS index
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
145
                      #-sb-thread (sb-vm::sap-ref-lispobj from sb-vm:n-word-bytes)))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
146
             (show sym val))
85f27597cf60 castable added, still testing
ellis <ellis@rwest.io>
parents: 118
diff changeset
147
           (setq from (sb-vm::sap+ from (* sb-vm:binding-size sb-vm:n-word-bytes))))))))
162
cc74c0054bc1 prelude
ellis <ellis@rwest.io>
parents: 119
diff changeset
148
 
274
5f782d361e08 threads and db tweaks. fixed a tricky macro error caused by string-case, dat/html now works.
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
149
 (defun wait-for-threads (threads)
278
e597adef66c7 threads and bug fixes
Richard Westhaver <ellis@rwest.io>
parents: 277
diff changeset
150
   (map 'list (lambda (thread) (sb-thread:join-thread thread :default nil)) threads)
274
5f782d361e08 threads and db tweaks. fixed a tricky macro error caused by string-case, dat/html now works.
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
151
   (not (some #'sb-thread:thread-alive-p threads)))
5f782d361e08 threads and db tweaks. fixed a tricky macro error caused by string-case, dat/html now works.
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
152
 (defun process-all-interrupts (&optional (thread sb-thread:*current-thread*))
5f782d361e08 threads and db tweaks. fixed a tricky macro error caused by string-case, dat/html now works.
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
153
   (sb-ext:wait-for (null (sb-thread::thread-interruptions thread))))