summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-29 22:03:29 +0000
committerMiles Bader <miles@gnu.org>1995-08-29 22:03:29 +0000
commit8664c57883c96fa26791c2b00278e5163a2ea940 (patch)
tree4012f8918c8e88fb4235464dc5864fcdc10580f7
parentb440cc5cb254525c6464bfd91ff6db2fab135f10 (diff)
(struct pipe): Remove interrupt_seq_num field.
(pipe_wait): Use hurd_condition_wait to detect interrupts instead of previous ad-hoc mechanism.
-rw-r--r--libpipe/pipe.h13
1 files changed, 1 insertions, 12 deletions
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;