Author: markj
Date: Thu May 25 01:09:45 2017
New Revision: 318845
URL: https://svnweb.freebsd.org/changeset/base/318845

Log:
  MFC r318191:
  Let ptracestop() suspend threads sleeping in an SBDRY section.

Modified:
  stable/11/sys/kern/kern_sig.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_sig.c
==============================================================================
--- stable/11/sys/kern/kern_sig.c       Thu May 25 01:01:35 2017        
(r318844)
+++ stable/11/sys/kern/kern_sig.c       Thu May 25 01:09:45 2017        
(r318845)
@@ -2495,6 +2495,7 @@ sig_suspend_threads(struct thread *td, s
 
        PROC_LOCK_ASSERT(p, MA_OWNED);
        PROC_SLOCK_ASSERT(p, MA_OWNED);
+       MPASS(sending || td == curthread);
 
        wakeup_swapper = 0;
        FOREACH_THREAD_IN_PROC(p, td2) {
@@ -2511,10 +2512,9 @@ sig_suspend_threads(struct thread *td, s
                                 */
                                KASSERT(!TD_IS_SUSPENDED(td2),
                                    ("thread with deferred stops suspended"));
-                               if (TD_SBDRY_INTR(td2) && sending) {
+                               if (TD_SBDRY_INTR(td2))
                                        wakeup_swapper |= sleepq_abort(td2,
                                            TD_SBDRY_ERRNO(td2));
-                               }
                        } else if (!TD_IS_SUSPENDED(td2)) {
                                thread_suspend_one(td2);
                        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to