Added in version 188.8.131.52 of package base.
The second argument to poll is #f when poll is called to check whether the event is ready. The result must be two values. The first result value is a list of results if evt is ready, or it is #f if evt is not ready. The second result value is #f if evt is ready, or it is an event to replace evt (often just evt itself) if evt is not ready.
When the thread scheduler has determined that the Racket process should sleep until an external event or timeout, then poll is called with a non-#f second argument, wakeups. In that case, if the first result value is a list, then the sleep will be canceled, but the list is not recorded as the result (and poll most likely will be called again). In addition to returning a #f initial value, poll can call unsafe-poll-ctx-fd-wakeup, unsafe-poll-ctx-eventmask-wakeup, and/or unsafe-poll-ctx-milliseconds-wakeup on wakeups to register wakeup triggers.
fd : exact-integer? mode : '(read write) socket? : any/c = #t
Added in version 184.108.40.206 of package base.
(unsafe-poll-ctx-milliseconds-wakeup wakeups msecs) → void? wakeups : any/c msecs : flonum?
(unsafe-set-sleep-in-thread! foreground-sleep fd) → void? foreground-sleep : (-> any/c) fd : fixnum?
This function works on when OS-level threads are available within the Racket implementation. It always works for Mac OS.
Synchronizaiton between the result of unsafe-make-signal-received and the scheduler will ensure the equivalent of (memory-order-release) before the call to the function produced by unsafe-make-signal-received and the equivalent of (memory-order-acquire) before the scheduler’s invocation of pollers.
Added in version 220.127.116.11 of package base.