Commit c978fc0c by Dave Cooper

rolled CCL wait hack into gwl/zzinit/source/initialize.lisp

parent 59c6dc0c
(in-package :ccl)
(let (*warn-if-redefine-kernel*)
(defun %windows-sleep (millis)
(dotimes (n 3)
(unless (typep millis '(unsigned-byte 32))
(setq millis (/ millis 100))))
(do* ((start (floor (get-internal-real-time)
(floor internal-time-units-per-second 1000))
(floor (get-internal-real-time)
(floor internal-time-units-per-second 1000)))
(millis millis (- stop start))
(stop (+ start millis)))
((or (<= millis 0)
(not (eql (#_SleepEx millis #$true) #$WAIT_IO_COMPLETION)))))))
......@@ -217,7 +217,41 @@ Perhaps a zombie process is holding port ~a?~%" port port))
;;
#+(and ccl windows-target)
(load (compile-file (merge-pathnames "fix-windows-ccl-sleep.lisp" *load-truename*)))
(in-package :ccl)
(defparameter *set-_?* nil)
(defparameter *set-$?* nil)
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (get-dispatch-macro-character #\# #\_)
(setq *set-_?* t)
(set-dispatch-macro-character #\# #\_ #'(lambda(s subchar arg) (declare (ignore s subchar arg))nil)))
(unless (get-dispatch-macro-character #\# #\$)
(setq *set-$?* t)
(set-dispatch-macro-character #\# #\$ #'(lambda(s subchar arg) (declare (ignore s subchar arg)) nil))))
#+(and ccl windows-target)
(let (*warn-if-redefine-kernel*)
(defun %windows-sleep (millis)
(dotimes (n 3)
(unless (typep millis '(unsigned-byte 32))
(setq millis (/ millis 100))))
(do* ((start (floor (get-internal-real-time)
(floor internal-time-units-per-second 1000))
(floor (get-internal-real-time)
(floor internal-time-units-per-second 1000)))
(millis millis (- stop start))
(stop (+ start millis)))
((or (<= millis 0)
(not (eql (#_SleepEx millis #$true) #$WAIT_IO_COMPLETION)))))))
(eval-when (:compile-toplevel :load-toplevel :execute)
(when *set-_?* (set-dispatch-macro-character #\# #\_ nil))
(when *set-$?* (set-dispatch-macro-character #\# #\$ nil)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment