PERFORCE change 114200 for review
Attilio Rao
attilio at freebsd.org
Wed Feb 7 20:50:18 UTC 2007
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)
Attilio
--
Peace can only be achieved by understanding - A. Einstein
More information about the p4-projects
mailing list