8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
29 */
30
31 #include <sys/types.h>
32 #include <sys/uio.h>
33 #include <sys/param.h>
34 #include <sys/cmn_err.h>
35 #include <sys/cred.h>
36 #include <sys/policy.h>
37 #include <sys/debug.h>
38 #include <sys/errno.h>
39 #include <sys/file.h>
40 #include <sys/inline.h>
41 #include <sys/kmem.h>
42 #include <sys/proc.h>
43 #include <sys/brand.h>
44 #include <sys/regset.h>
45 #include <sys/sysmacros.h>
46 #include <sys/systm.h>
47 #include <sys/vfs.h>
48 #include <sys/vnode.h>
1464 (sig == SIGSTOP || !p->p_pgidp->pid_pgorphaned))
1465 p->p_flag &= ~SSCONT;
1466 sigdelq(p, NULL, SIGCONT);
1467 sigdelset(&p->p_sig, SIGCONT);
1468 sigdelset(&p->p_extsig, SIGCONT);
1469 if ((tx = p->p_tlist) != NULL) {
1470 do {
1471 sigdelq(p, tx, SIGCONT);
1472 sigdelset(&tx->t_sig, SIGCONT);
1473 sigdelset(&tx->t_extsig, SIGCONT);
1474 } while ((tx = tx->t_forw) != p->p_tlist);
1475 }
1476 }
1477 thread_lock(t);
1478 if (ISWAKEABLE(t) || ISWAITING(t)) {
1479 /* Set signaled sleeping/waiting lwp running */
1480 setrun_locked(t);
1481 } else if (t->t_state == TS_STOPPED && sig == SIGKILL) {
1482 /* If SIGKILL, set stopped lwp running */
1483 p->p_stopsig = 0;
1484 t->t_schedflag |= TS_XSTART | TS_PSTART;
1485 t->t_dtrace_stop = 0;
1486 setrun_locked(t);
1487 }
1488 t->t_sig_check = 1; /* so ISSIG will be done */
1489 thread_unlock(t);
1490 /*
1491 * More jobcontrol side-effects.
1492 */
1493 if (sig == SIGCONT && (tx = p->p_tlist) != NULL) {
1494 p->p_stopsig = 0;
1495 do {
1496 thread_lock(tx);
1497 if (tx->t_state == TS_STOPPED &&
1498 tx->t_whystop == PR_JOBCONTROL) {
1499 tx->t_schedflag |= TS_XSTART;
1500 setrun_locked(tx);
1501 }
1502 thread_unlock(tx);
1503 } while ((tx = tx->t_forw) != p->p_tlist);
1504 }
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright 2015, Joyent, Inc.
29 */
30
31 #include <sys/types.h>
32 #include <sys/uio.h>
33 #include <sys/param.h>
34 #include <sys/cmn_err.h>
35 #include <sys/cred.h>
36 #include <sys/policy.h>
37 #include <sys/debug.h>
38 #include <sys/errno.h>
39 #include <sys/file.h>
40 #include <sys/inline.h>
41 #include <sys/kmem.h>
42 #include <sys/proc.h>
43 #include <sys/brand.h>
44 #include <sys/regset.h>
45 #include <sys/sysmacros.h>
46 #include <sys/systm.h>
47 #include <sys/vfs.h>
48 #include <sys/vnode.h>
1464 (sig == SIGSTOP || !p->p_pgidp->pid_pgorphaned))
1465 p->p_flag &= ~SSCONT;
1466 sigdelq(p, NULL, SIGCONT);
1467 sigdelset(&p->p_sig, SIGCONT);
1468 sigdelset(&p->p_extsig, SIGCONT);
1469 if ((tx = p->p_tlist) != NULL) {
1470 do {
1471 sigdelq(p, tx, SIGCONT);
1472 sigdelset(&tx->t_sig, SIGCONT);
1473 sigdelset(&tx->t_extsig, SIGCONT);
1474 } while ((tx = tx->t_forw) != p->p_tlist);
1475 }
1476 }
1477 thread_lock(t);
1478 if (ISWAKEABLE(t) || ISWAITING(t)) {
1479 /* Set signaled sleeping/waiting lwp running */
1480 setrun_locked(t);
1481 } else if (t->t_state == TS_STOPPED && sig == SIGKILL) {
1482 /* If SIGKILL, set stopped lwp running */
1483 p->p_stopsig = 0;
1484 t->t_schedflag |= TS_XSTART | TS_PSTART | TS_BSTART;
1485 t->t_dtrace_stop = 0;
1486 setrun_locked(t);
1487 }
1488 t->t_sig_check = 1; /* so ISSIG will be done */
1489 thread_unlock(t);
1490 /*
1491 * More jobcontrol side-effects.
1492 */
1493 if (sig == SIGCONT && (tx = p->p_tlist) != NULL) {
1494 p->p_stopsig = 0;
1495 do {
1496 thread_lock(tx);
1497 if (tx->t_state == TS_STOPPED &&
1498 tx->t_whystop == PR_JOBCONTROL) {
1499 tx->t_schedflag |= TS_XSTART;
1500 setrun_locked(tx);
1501 }
1502 thread_unlock(tx);
1503 } while ((tx = tx->t_forw) != p->p_tlist);
1504 }
|