summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-fileops.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-08-22 20:03:11 -0400
committerAndy Walls <awalls@radix.net>2008-08-22 20:03:11 -0400
commit212438136868cf522ade051b9dcfb749643a7c16 (patch)
treebcb850d02e84015f1a2f5e114f223e79036de184 /linux/drivers/media/video/cx18/cx18-fileops.c
parentdbcd49d6f8956af76b5e13e4967054f3983732f2 (diff)
downloadmediapointer-dvb-s2-212438136868cf522ade051b9dcfb749643a7c16.tar.gz
mediapointer-dvb-s2-212438136868cf522ade051b9dcfb749643a7c16.tar.bz2
cx18: Convert cx18_queue buffers member to atomic_t
From: Andy Walls <awalls@radix.net> cx18: Convert cx18_queue buffers member to atomic_t. This allows safe concurrent access to check if a queue has data without having to acquire the queue spinlock. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-fileops.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-fileops.c b/linux/drivers/media/video/cx18/cx18-fileops.c
index 7296e9100..faae7942c 100644
--- a/linux/drivers/media/video/cx18/cx18-fileops.c
+++ b/linux/drivers/media/video/cx18/cx18-fileops.c
@@ -258,7 +258,7 @@ static struct cx18_buffer *cx18_get_buffer(struct cx18_stream *s, int non_block,
prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE);
/* New buffers might have become available before we were added
to the waitqueue */
- if (!s->q_full.buffers)
+ if (!atomic_read(&s->q_full.buffers))
schedule();
finish_wait(&s->waitq, &wait);
if (signal_pending(current)) {
@@ -544,7 +544,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
CX18_DEBUG_HI_FILE("Encoder poll\n");
poll_wait(filp, &s->waitq, wait);
- if (s->q_full.buffers || s->q_io.buffers)
+ if (atomic_read(&s->q_full.buffers) || atomic_read(&s->q_io.buffers))
return POLLIN | POLLRDNORM;
if (eof)
return POLLHUP;