Author: kib
Date: Mon May 10 15:19:12 2010
New Revision: 207848
URL: http://svn.freebsd.org/changeset/base/207848

Log:
  The thread_unsuspend() requires both process mutex and process spinlock
  locked. Postpone the process unlock till the thread_unsuspend() is called.
  
  Approved by:  des (procfs maintainer)
  MFC after:    1 week

Modified:
  head/sys/fs/procfs/procfs_ctl.c

Modified: head/sys/fs/procfs/procfs_ctl.c
==============================================================================
--- head/sys/fs/procfs/procfs_ctl.c     Mon May 10 15:18:03 2010        
(r207847)
+++ head/sys/fs/procfs/procfs_ctl.c     Mon May 10 15:19:12 2010        
(r207848)
@@ -236,7 +236,6 @@ out:
                        PROC_LOCK(p);
                p->p_oppid = 0;
                p->p_flag &= ~P_WAITED; /* XXX ? */
-               PROC_UNLOCK(p);
                sx_xunlock(&proctree_lock);
 
                wakeup(td->td_proc);    /* XXX for CTL_WAIT below ? */
@@ -249,9 +248,10 @@ out:
         */
        case PROCFS_CTL_STEP:
                error = proc_sstep(FIRST_THREAD_IN_PROC(p));
-               PROC_UNLOCK(p);
-               if (error)
+               if (error) {
+                       PROC_UNLOCK(p);
                        return (error);
+               }
                break;
 
        /*
@@ -260,7 +260,6 @@ out:
         */
        case PROCFS_CTL_RUN:
                p->p_flag &= ~P_STOPPED_SIG;    /* this uses SIGSTOP */
-               PROC_UNLOCK(p);
                break;
 
        /*
@@ -292,6 +291,7 @@ out:
        PROC_SLOCK(p);
        thread_unsuspend(p); /* If it can run, let it do so. */
        PROC_SUNLOCK(p);
+       PROC_UNLOCK(p);
        return (0);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to