diff options
author | Alexander Kolbasov <Alexander.Kolbasov@Sun.COM> | 2009-12-22 21:52:00 -0800 |
---|---|---|
committer | Alexander Kolbasov <Alexander.Kolbasov@Sun.COM> | 2009-12-22 21:52:00 -0800 |
commit | b885580b43755ee4ea1e280b85428893d2ba9291 (patch) | |
tree | f7f7848d3eef390282bab6fc859d7a5275053ecf /usr/src/lib/libcpc/common/libcpc.c | |
parent | e7437094ebbbd4d60375f3927c017ff00cbab1de (diff) | |
download | illumos-joyent-b885580b43755ee4ea1e280b85428893d2ba9291.tar.gz |
6764832 Provide user-level processor groups observability
6831680 cputrack(1) leaves its victim with unneeded cpc context
6901343 cpc context flag updates are not always atomic
6908152 Dormant thread CPC context affects cpu CPC consumers
Diffstat (limited to 'usr/src/lib/libcpc/common/libcpc.c')
-rw-r--r-- | usr/src/lib/libcpc/common/libcpc.c | 25 |
1 files changed, 25 insertions, 0 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; |