Changeset 10880


Ignore:
Timestamp:
Sep 25, 2008, 1:27:28 PM (11 years ago)
Author:
gb
Message:

Break out %WINDOWS-SLEEP from SLEEP. (Should maybe call %WINDOWS-SLEEP
in housekeeping-loop.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/time.lisp

    r10829 r10880  
    201201
    202202
     203#+windows-target
     204(defun %windows-sleep (millis)
     205  (do* ((start (floor (get-internal-real-time)
     206                      (floor internal-time-units-per-second 1000))
     207               (floor (get-internal-real-time)
     208                      (floor internal-time-units-per-second 1000)))
     209        (millis millis (- stop start))
     210        (stop (+ start millis)))
     211       ((or (<= millis 0)
     212            (not (eql (#_SleepEx millis #$true) #$WAIT_IO_COMPLETION))))))
    203213
    204214(defun sleep (seconds)
     
    211221    (%nanosleep secs nanos))
    212222  #+windows-target
    213   (do* ((start (floor (get-internal-real-time)
    214                        (floor internal-time-units-per-second 1000))
    215                (floor (get-internal-real-time)
    216                        (floor internal-time-units-per-second 1000)))
    217          (millis (round (* seconds 1000)) (- stop start))
    218          (stop (+ start millis)))
    219        ((or (<= millis 0)
    220             (not (eql (#_SleepEx millis #$true) #$WAIT_IO_COMPLETION))))))
     223  (%windows-sleep (round (* seconds 1000))))
    221224
    222225
Note: See TracChangeset for help on using the changeset viewer.