From 8664c57883c96fa26791c2b00278e5163a2ea940 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 29 Aug 1995 22:03:29 +0000 Subject: (struct pipe): Remove interrupt_seq_num field. (pipe_wait): Use hurd_condition_wait to detect interrupts instead of previous ad-hoc mechanism. --- libpipe/pipe.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'libpipe/pipe.h') diff --git a/libpipe/pipe.h b/libpipe/pipe.h index 01a92195..b809c1bf 100644 --- a/libpipe/pipe.h +++ b/libpipe/pipe.h @@ -77,15 +77,6 @@ struct pipe struct mutex lock; - /* When a pipe receives an interrupt, we want to wake up all pending read - threads, and have them realize they've been interrupted; reads that - happen after the interrupt shouldn't return EINTR. When a thread waits - on this pipe's PENDING_READS condition, it remembers this sequence - number; any interrupt bumps this number and broadcasts on the condition. - A reader thread will try to read from the pipe only if the sequence - number is the same as when it went to sleep. */ - unsigned long interrupt_seq_num; - /* A queue of incoming packets, of type either PACKET_TYPE_DATA or PACKET_TYPE_CONTROL. Each data packet represents one datagram for protocols that maintain record boundaries. Control packets always @@ -140,11 +131,9 @@ pipe_wait (struct pipe *pipe, int noblock, int data_only) { while (! pipe_is_readable (pipe, data_only) && ! (pipe->flags & PIPE_BROKEN)) { - unsigned seq_num = pipe->interrupt_seq_num; if (noblock) return EWOULDBLOCK; - condition_wait (&pipe->pending_reads, &pipe->lock); - if (seq_num != pipe->interrupt_seq_num) + if (hurd_condition_wait (&pipe->pending_reads, &pipe->lock)) return EINTR; } return 0; -- cgit v1.2.3