[email protected]
[Top] [All Lists]

Re: PERFORCE change 114200 for review

Subject: Re: PERFORCE change 114200 for review
From: "Attilio Rao"
Date: Wed, 7 Feb 2007 21:50:08 +0100
2007/2/7, Roman Divacky <[email protected]>:
http://perforce.freebsd.org/chv.cgi?CH=114200

Change 114200 by [email protected]_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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>