Update of /cvsroot/alsa/alsa-lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv29424
Modified Files:
code.c
Log Message:
Reduced race window
Index: code.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/test/code.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- code.c 1 Mar 2003 11:16:42 -0000 1.10
+++ code.c 1 Mar 2003 14:24:42 -0000 1.11
@@ -149,8 +149,9 @@
{
while (size-- > 0) {
s32 sample = *src;
+ s32 old_sample = *sum;
if (cmpxchg(dst, 0, 1) == 0)
- sample -= *sum;
+ sample -= old_sample;
atomic_add(sum, sample);
do {
sample = *sum;
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog