Skip to content

Commit

Permalink
std/event: fix handling of timeouts in wait-io
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jul 22, 2023
1 parent e76fd31 commit 1d2917b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/std/event.ss
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
(mutex-unlock! mx))))

(def (selector-wait-io-condvar sel timeo)
(##wait-for-io! sel (or timeo #t)))
(##wait-for-io! sel (if timeo (timeout->abs-timeout->seconds timeo) #t)))

(def (maybe-timeout? obj)
(or (not obj)
Expand All @@ -151,6 +151,11 @@
(if (time? timeo) timeo
(seconds->time (+ (##current-time-point) timeo))))

(def (timeout->abs-timeout->seconds timeo)
(if (time? timeo)
(time->seconds timeo)
(+ (##current-time-point) timeo)))

(def (io-condition-variable? obj)
(and (condition-variable? obj)
(##foreign? (macro-condvar-name obj))))
Expand Down

0 comments on commit 1d2917b

Please sign in to comment.