diff options
Diffstat (limited to 'usr/src/lib/libcpc')
| -rw-r--r-- | usr/src/lib/libcpc/common/libcpc.c | 25 | ||||
| -rw-r--r-- | usr/src/lib/libcpc/common/libcpc.h | 4 | ||||
| -rw-r--r-- | usr/src/lib/libcpc/common/mapfile-vers | 1 |
3 files changed, 29 insertions, 1 deletions
diff --git a/usr/src/lib/libcpc/common/libcpc.c b/usr/src/lib/libcpc/common/libcpc.c index 5bdba39fda..9f4f6ac848 100644 --- a/usr/src/lib/libcpc/common/libcpc.c +++ b/usr/src/lib/libcpc/common/libcpc.c @@ -168,6 +168,23 @@ cpc_close(cpc_t *cpc) return (0); } +/* + * Terminate everything that runs in pctx_run + */ +void +cpc_terminate(cpc_t *cpc) +{ + cpc_set_t *csp; + int sigblocked; + + sigblocked = cpc_lock(cpc); + for (csp = cpc->cpc_sets; csp != NULL; csp = csp->cs_next) { + if (csp->cs_pctx != NULL) + pctx_terminate(csp->cs_pctx); + } + cpc_unlock(cpc, sigblocked); +} + cpc_set_t * cpc_set_create(cpc_t *cpc) { @@ -224,6 +241,14 @@ cpc_set_destroy(cpc_t *cpc, cpc_set_t *set) if (csp->cs_state != CS_UNBOUND) (void) cpc_unbind(cpc, csp); + /* + * Detach from the process + */ + if (csp->cs_pctx != NULL) { + pctx_release(csp->cs_pctx); + csp->cs_pctx = NULL; + } + for (req = csp->cs_request; req != NULL; req = next) { next = req->cr_next; diff --git a/usr/src/lib/libcpc/common/libcpc.h b/usr/src/lib/libcpc/common/libcpc.h index 384474a76c..73627345a0 100644 --- a/usr/src/lib/libcpc/common/libcpc.h +++ b/usr/src/lib/libcpc/common/libcpc.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -163,6 +163,8 @@ extern void cpc_walk_attrs(cpc_t *cpc, void *arg, extern int cpc_enable(cpc_t *cpc); extern int cpc_disable(cpc_t *cpc); +extern void cpc_terminate(cpc_t *); + #if defined(__sparc) || defined(__i386) /* diff --git a/usr/src/lib/libcpc/common/mapfile-vers b/usr/src/lib/libcpc/common/mapfile-vers index 91f1689c9f..e577fc7c5e 100644 --- a/usr/src/lib/libcpc/common/mapfile-vers +++ b/usr/src/lib/libcpc/common/mapfile-vers @@ -83,6 +83,7 @@ SUNW_1.2 { SUNWprivate_1.1 { global: SUNWprivate_1.1; + cpc_terminate; local: *; }; |
