PERFORCE change 114200 for review

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Wed Feb 7 21:54:48 UTC 2007


On Wed, Feb 07, 2007 at 09:50:08PM +0100, Attilio Rao wrote:
> 2007/2/7, Roman Divacky <rdivacky at freebsd.org>:
> >http://perforce.freebsd.org/chv.cgi?CH=114200
> >
> >Change 114200 by rdivacky at rdivacky_witten on 2007/02/07 18:57:25
> >
> >       Move the free() out of the emul_shared_lock coverage as its not
> >       sleepable lock anymore.
> >
> >Affected files ...
> >
> >.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#35 edit
> >
> >Differences ...
> >
> >==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#35 
> >(text+ko) ====
> >
> >@@ -187,9 +187,11 @@
> >       LIST_REMOVE(em, threads);
> >
> >       em->shared->refs--;
> >-       if (em->shared->refs == 0)
> >+       if (em->shared->refs == 0) {
> >+               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >               free(em->shared, M_LINUX);
> >-       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >+       } else
> >+               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >
> >       if (child_clear_tid != NULL) {
> >               struct linux_sys_futex_args cup;
> >@@ -274,9 +276,11 @@
> >               PROC_UNLOCK(p);
> >
> >               em->shared->refs--;
> >-               if (em->shared->refs == 0)
> >+               if (em->shared->refs == 0) {
> >+                       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >                       free(em->shared, M_LINUX);
> >-               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >+               } else
> >+                       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >
> >               free(em, M_LINUX);
> >       }
> >
> 
> Would you convert em->shared->refs with a refcount() ? (sys/refcount.h)

as we discussed. its not much of a use in this particular case
as I have to lock anyway so this doesnt buy us much.

thnx, roman


More information about the p4-projects mailing list