summaryrefslogtreecommitdiff
path: root/pflocal/io.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-29 22:05:08 +0000
committerMiles Bader <miles@gnu.org>1995-08-29 22:05:08 +0000
commita86d03817f7355fbf522b2f9588479f40a3ff2e2 (patch)
tree4f1bb2165c1d2396b77b3ff6bb2889f6d5d42644 /pflocal/io.c
parent77f4bcd690825fc95ec47173d86c1e5db5405b7b (diff)
(S_interrupt_operation): Use ports_interrupt_rpc to interrupt waiting threads.
Diffstat (limited to 'pflocal/io.c')
-rw-r--r--pflocal/io.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/pflocal/io.c b/pflocal/io.c
index 3468cb35..9fa933ff 100644
--- a/pflocal/io.c
+++ b/pflocal/io.c
@@ -114,37 +114,11 @@ S_io_write (struct sock_user *user,
error_t
S_interrupt_operation (mach_port_t port)
{
- struct sock *sock;
- struct pipe *pipe;
struct sock_user *user = ports_lookup_port (sock_port_bucket, port, 0);
-
if (!user)
return EOPNOTSUPP;
-
- sock = user->sock;
-
- /* Interrupt anyone trying to connect or listening for connections. */
- if (sock->listen_queue)
- connq_interrupt (sock->listen_queue);
-
- /* Interrupt SOCK's pending connection. */
- mutex_lock (&sock->lock);
- if (sock->connect_queue)
- connq_interrupt_sock (sock->connect_queue, sock);
- mutex_unlock (&sock->lock);
-
- /* Interrupt pending reads on this socket. We don't bother with writes
- since they never block. */
- if (sock_acquire_read_pipe (sock, &pipe) == 0)
- {
- /* Indicate to currently waiting threads they've been interrupted. */
- pipe->interrupt_seq_num++;
- pipe_kick (pipe);
- pipe_release_reader (pipe);
- }
-
+ ports_interrupt_rpc (user);
ports_port_deref (user);
-
return 0;
}