Remove without-interrupts from runtime/io.scm.
Channel-read and channel-write used without-interrupts for atomicity,
to avoid calling primitives with a channel another thread has closed.
The resulting errors may have been expensive to handle, but the cheap
technique of calling without-interrupts is ineffective in SMPing
worlds. Assuming most channels are used by one thread and will not
encounter these errors, just punt the calls to without-interrupts.
Serialize modifications to the channel table (esp. channel-close) via
the open-channels gc finalizer's atomic section and the new
with-gc-finalizer-lock procedure.
Remove tty-input-channel and tty-output-channel from general use.
They are only used in a cold load initialize-package! procedure and an
after-restore reset-console procedure. They are not fit for general
use, creating a new channel object each time they are called, only the
newest one of which is returned by descriptor->channel. Assume these
procedures are only used in single threaded fashion.
In open-pty-master, directory-channel-open and make-select-registry,
replace without-interrupts with without-interruption to avoid dropping
a channel or registry because of an inopportune abort. GC finalizers
like open-channels and open-directories (and select-registry-
finalizer) are already serializing.
Do NOT export channel-descriptor-for-select to the () package. Assume
select registries and their result vectors are used ONLY internally,
in single threaded fashion, by the thread system. Punt the
unnecessary and now useless calls to without-interrupts.
In dld-load-file and dld-unload-file, serialize access to the
dld-handles via dld-handles-mutex.