[pulseaudio-commits] r1514 - /branches/lennart/src/pulsecore/memblock.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Jul 13 05:12:41 PDT 2007


Author: lennart
Date: Fri Jul 13 14:12:40 2007
New Revision: 1514

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1514&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Fix concurrency bug when turning memblock into a local memblock

Modified:
    branches/lennart/src/pulsecore/memblock.c

Modified: branches/lennart/src/pulsecore/memblock.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
memblock.c?rev=3D1514&root=3Dpulseaudio&r1=3D1513&r2=3D1514&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/memblock.c (original)
+++ branches/lennart/src/pulsecore/memblock.c Fri Jul 13 14:12:40 2007
@@ -567,10 +567,10 @@
     assert(PA_REFCNT_VALUE(b) > 0);
     assert(b->type =3D=3D PA_MEMBLOCK_FIXED);
 =

-    if (PA_REFCNT_DEC(b) > 0)
+    if (PA_REFCNT_VALUE(b) > 1)
         memblock_make_local(b);
-    else
-        memblock_free(b);
+
+    pa_memblock_unref(b);
 }
 =

 /* Self-locked. This function is not multiple-caller safe */




More information about the pulseaudio-commits mailing list