racket/racket
Matthew Flatt 2d0f10f473 rktio: better behavior for opening write and of fifo
When opening the write end of a fifo that doesn't have a reader
already, the old implementation could allow writing bytes that are
discarded. This new implementation uses a blocking `open` in a
`pthread`, and that way the write routines know whether the stream is
ready for writing or not.

The difference is visible in the Racket API in a two places:
`subprocess` needs to wait until a fifo writer is connected before
attempting to dup the corresponding file descriotor, and more
generally a use of `unsafe-port->file-descriptor` needs to wait. The
former blocking operation is now build into `subprocess` (and
documented), but the burden is place on callers of
`unsafe-port->file-descriptor` to wait is necessary.

The new `port-waiting-peer?` predicate exposes the waiting state,
while `sync` is sufficient to wait for a peer.

Closes #2784
2019-08-22 05:14:58 -06:00
..
collects ffi/unsafe/alloc: allow #f as an "allocator" 2019-08-15 09:42:10 +02:00
src rktio: better behavior for opening write and of fifo 2019-08-22 05:14:58 -06:00
.gitignore internal hooks to build "Racket.exe" without "libracket3m.dll" 2015-03-28 09:50:01 -06:00