Commit 4235c177 authored by John Levon's avatar John Levon Committed by Linus Torvalds

[PATCH] OProfile update

If there's are multiple tasks sleeping inside the read routine ever, this is necessary.
parent 27c14ce8
......@@ -151,11 +151,15 @@ ssize_t event_buffer_read(struct file * file, char * buf, size_t count, loff_t *
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment