+ (with-session
+ (when (update-thread *empire-session*)
+ (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-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)
+ (nconc next-updates (list (parenscript:ps* '(next))))
+ (apply #'concatenate 'string next-updates))))