Open given port another time to allow for repeated closing.
FIXME: Should this better pass out a new port value? Then, closing that new
port handle while not closing the whole port should invalidate that new
handle. (Would probably, at least, be nicer for debugging.)
Close a port.
- If the port has been opened multiple times, it can be closed the
corresponding number of times before it will be irrevocably shut, whereby
creation of a port counts as one opening.
- Closing an already closed port is a no-op.
Check whether a given port is closed.
- ATTENTION: This routine is a potential source of race conditions. Use
with care. If this routine returns False, the state of the port may
have changed by the time the return value is inspected.
Associate a thread with a port
- Sets the thread id and a synchronisation variable that will be set by the
thread when it terminates
Synchronise on the synchronisation variable in a port's thread info, which
is set as soon as the thread terminates.
- If a thread is associate with more than one port, waiting for any or all
ports will have the same effect
FIXME: should we also wait until the port is closed? (if the thread
traverses the whole port stream stream, it won't terminate until the port is
Synchronise on a port being closed.
FIXME: It would be more efficient if a port would keep a list of threads to
notify when a port is being closed.
|Wait until both the port is closed and the corresponding thread has
|Ensure that the port is closed before waiting for the associated thread to
|Produced by Haddock version 2.6.0|