[PATCH 4/8] OProfile update

John Levon (levon@movementarian.org)
Sun, 4 May 2003 00:44:06 +0100


If there's are multiple tasks sleeping inside the read routine ever, this is necessary.

diff -Naur -X dontdiff linux-cvs/drivers/oprofile/event_buffer.c linux-me/drivers/oprofile/event_buffer.c
--- linux-cvs/drivers/oprofile/event_buffer.c 2002-12-21 19:18:20.000000000 +0000
+++ linux-me/drivers/oprofile/event_buffer.c 2003-04-29 01:09:35.000000000 +0100
@@ -151,11 +151,15 @@
if (count != max || *offset)
return -EINVAL;

- /* wait for the event buffer to fill up with some data */
wait_event_interruptible(buffer_wait, atomic_read(&buffer_ready));
+
if (signal_pending(current))
return -EINTR;

+ /* can't currently happen */
+ if (!atomic_read(&buffer_ready))
+ return -EAGAIN;
+
down(&buffer_sem);

atomic_set(&buffer_ready, 0);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/