X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fserve-event.lisp;h=ca055edf437fb56635fe98eb300452ef9dea1b4d;hb=c017b878e30a0bc9a175d3f5a1a4d3537804160c;hp=2b72d840f61b26227d1692e6ee984b8d0ce819f5;hpb=f48ea2de68cabd283203219cf2393e2825fac8e9;p=sbcl.git diff --git a/src/code/serve-event.lisp b/src/code/serve-event.lisp index 2b72d84..ca055ed 100644 --- a/src/code/serve-event.lisp +++ b/src/code/serve-event.lisp @@ -175,15 +175,9 @@ waiting." (flet ((maybe-update-timeout () ;; If we return early, recompute the timeouts, possibly ;; signaling the deadline or returning with NIL to caller. - (multiple-value-bind (sec usec) - (decode-internal-time (get-internal-real-time)) - (setf to-sec (- stop-sec sec)) - (cond ((> usec stop-usec) - (decf to-sec) - (setf to-usec (- (+ stop-usec 1000000) usec))) - (t - (setf to-usec (- stop-usec usec))))) - (when (or (minusp to-sec) (and (zerop to-sec) (not (plusp to-usec)))) + (setf (values to-sec to-usec) + (relative-decoded-times stop-sec stop-usec)) + (when (and (zerop to-sec) (not (plusp to-usec))) (cond (signalp (signal-deadline) (go :restart)) @@ -211,7 +205,8 @@ waiting." (loop for to-msec = (if (and to-sec to-usec) (+ (* 1000 to-sec) (truncate to-usec 1000)) -1) - when (sb!unix:unix-simple-poll fd direction to-msec) + when (or #!+win32 (eq direction :output) + (sb!unix:unix-simple-poll fd direction to-msec)) do (return-from wait-until-fd-usable t) else do (when to-sec (maybe-update-timeout))))))))