[pulseaudio-commits] r1634 - /branches/lennart/src/pulsecore/fdsem.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Aug 11 09:00:07 PDT 2007


Author: lennart
Date: Sat Aug 11 18:00:02 2007
New Revision: 1634

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1634&root=3Dpulseaudio&vi=
ew=3Drev
Log:
allow destruction of pa_fdsem object that are still in 'poll' state

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

Modified: branches/lennart/src/pulsecore/fdsem.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
fdsem.c?rev=3D1634&root=3Dpulseaudio&r1=3D1633&r2=3D1634&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/fdsem.c (original)
+++ branches/lennart/src/pulsecore/fdsem.c Sat Aug 11 18:00:02 2007
@@ -64,8 +64,6 @@
 void pa_fdsem_free(pa_fdsem *f) {
     pa_assert(f);
 =

-    pa_assert(pa_atomic_load(&f->waiting) =3D=3D 0);
-    =

     close(f->fds[0]);
     close(f->fds[1]);
 =

@@ -168,17 +166,16 @@
     pa_atomic_inc(&f->waiting);
 =

     if (pa_atomic_cmpxchg(&f->signalled, 1, 0)) {
-        pa_atomic_dec(&f->waiting);
+        pa_assert_se(pa_atomic_dec(&f->waiting) >=3D 1);
         return -1;
-    }
-        =

+    }        =

     return 0;
 }
 =

 int pa_fdsem_after_poll(pa_fdsem *f) {
     pa_assert(f);
 =

-    pa_atomic_dec(&f->waiting);
+    pa_assert_se(pa_atomic_dec(&f->waiting) >=3D 1);
 =

     flush(f);
 =





More information about the pulseaudio-commits mailing list