changeset 677:5dd1730abf98 libavutil

Comments to indicate where memory barriers may be needed.
author michael
date Sun, 08 Mar 2009 00:45:45 +0000
parents 5e391d180d81
children bcd0e6fe83d8
files fifo.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/fifo.c	Sat Mar 07 21:02:08 2009 +0000
+++ b/fifo.c	Sun Mar 08 00:45:45 2009 +0000
@@ -91,6 +91,7 @@
             memcpy(f->wptr, src, len);
             src = (uint8_t*)src + len;
         }
+// Write memory barrier needed for SMP here in theory
         f->wptr += len;
         if (f->wptr >= f->end)
             f->wptr = f->buffer;
@@ -103,6 +104,7 @@
 
 int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest)
 {
+// Read memory barrier needed for SMP here in theory
     do {
         int len = FFMIN(f->end - f->rptr, buf_size);
         if(func) func(dest, f->rptr, len);
@@ -110,6 +112,7 @@
             memcpy(dest, f->rptr, len);
             dest = (uint8_t*)dest + len;
         }
+// memory barrier needed for SMP here in theory
         av_fifo_drain(f, len);
         buf_size -= len;
     } while (buf_size > 0);