Skip to content
Snippets Groups Projects
Commit e565e0ec authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

sleep: fix faulty process-wait-with-timeout

parent 21244d0f
No related branches found
No related tags found
No related merge requests found
......@@ -178,7 +178,7 @@ rotation and scaling."
(with-scaling (stream i)
(draw-polygon* stream (aref *polygons* number-of-sides) :filled t
:ink (if (oddp i) +background-ink+ +foreground-ink+))))
(demo-sleep stream 2))))))
(demo-sleep stream 0.1))))))
(defparameter *random-ink-list*
(list +red+ +green+ +blue+
......@@ -221,7 +221,7 @@ to the window in which it is displayed."
;; draw finish
(draw-circle* stream 330 280 5)
(demo-sleep stream 3)
(demo-sleep stream 0.3)
;; draw a solution path
(draw-polygon* stream '(30 60 570 60 570 460 130 460 130 140 490 140
......
......@@ -216,9 +216,13 @@
(defun process-wait (reason predicate)
(declare (ignore reason))
(loop (when (funcall predicate) (return))
(sleep 0.1)
(process-yield)))
(defun process-wait-with-timeout (reason timeout predicate)
(declare (ignorable timeout))
(process-wait reason predicate)
#+ (or) ;; timeout is verified with a predicate (see above) o_O
(if (and (numberp timeout)
(not (zerop timeout)))
(bt:with-timeout (timeout) (process-wait reason predicate))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment