Now that the #:callback-exns? option for _fun has been added (in racket/racket@bf8741e), maybe guard-foreign-escape should use it:
|
;; The 'racket VM can handle concurrent callbacks in different Racket |
|
;; threads, because it copies the C stack in and out to implement |
|
;; threads. The 'chez-scheme VM cannot do that, so callbacks have to |
|
;; be atomic. Additional work is needed to allow erroe escapes; we |
|
;; assume that any error happens in an atomic callback that was |
|
;; triggered by a foreign call that disables interrupts (which seems |
|
;; like a fragile assumption!). |
|
;; |
|
;; Atomicity implies that a callback cannot read from or write to an |
|
;; arbitrary port, so we have to "sanitize" a port by adding an |
|
;; intermediary. Unfortunately, this means that reading from a port |
|
;; has to be eager. |
Now that the
#:callback-exns?option for_funhas been added (in racket/racket@bf8741e), maybeguard-foreign-escapeshould use it:draw/draw-lib/racket/draw/unsafe/callback.rkt
Lines 7 to 18 in 253dbf8