X-Git-Url: http://git.pond.sub.org/?p=eow;a=blobdiff_plain;f=web.lisp;h=c7ead803bf9f3a808610b80a10d0a286ed2447db;hp=68870b9571e2556f8d32e0a7cf48a2817d0ed1bd;hb=d0df339544e58ba26876518ca78eedc1ebb72583;hpb=827392a0b542ef62612e0e32b03a1ca4df21b2e2 diff --git a/web.lisp b/web.lisp index 68870b9..c7ead80 100644 --- a/web.lisp +++ b/web.lisp @@ -72,9 +72,12 @@ (empire-log:info "~a: Killing update thread ~a." *empire-session* (update-thread *empire-session*)) (sb-thread:terminate-thread (update-thread *empire-session*))) (setf (update-thread *empire-session*) sb-thread:*current-thread*) - (let ((next-update (locked-queue:dequeue (update-queue *empire-session*)))) + (let ((next-updates (locked-queue:dequeue-all (update-queue *empire-session*)))) + ; There's a race here. The next update thread might kill this one before + ; sending the reply. (setf (update-thread *empire-session*) nil) - next-update))) + (nconc next-updates (list (parenscript:ps* '(next)))) + (apply #'concatenate 'string next-updates)))) (defmethod send ((s session) string) "Push a javascript update fragment to the client."