summaryrefslogtreecommitdiff
path: root/usr/src/cmd/nscd/cache.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2018-10-08 15:34:11 +0100
committerDan McDonald <danmcd@joyent.com>2018-10-19 16:40:54 -0400
commitab618543cc6fc4bc273c077ef5d247961cdb29d4 (patch)
tree24c80e35e958a4c5fef77d444eacb1b4f45798a2 /usr/src/cmd/nscd/cache.c
parent62f63298eba531d48f87aa8c2089298cb7821962 (diff)
downloadillumos-joyent-ab618543cc6fc4bc273c077ef5d247961cdb29d4.tar.gz
8158 Want named threads API
9857 proc manpages should have LIBRARY section Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Gordon Ross <gwr@nexenta.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/cmd/nscd/cache.c')
-rw-r--r--usr/src/cmd/nscd/cache.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/cmd/nscd/cache.c b/usr/src/cmd/nscd/cache.c
index 2ffb95c30d..288c6e767e 100644
--- a/usr/src/cmd/nscd/cache.c
+++ b/usr/src/cmd/nscd/cache.c
@@ -22,6 +22,7 @@
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
* Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -1817,8 +1818,10 @@ init_cache_ctx(int i) {
static void
revalidate(nsc_ctx_t *ctx)
{
+ (void) thr_setname(thr_self(), "revalidate");
+
for (;;) {
- int i, slp, interval, count;
+ int i, slp, interval, count;
(void) rw_rdlock(&ctx->cfg_rwlp);
slp = ctx->cfg.pos_ttl;
@@ -1961,6 +1964,8 @@ static void
do_update(nsc_lookup_args_t *in) {
nss_pheader_t *phdr = (nss_pheader_t *)in->buffer;
+ (void) thr_setname(thr_self(), "do_update");
+
/* update the length of the data buffer */
phdr->data_len = phdr->pbufsiz - phdr->data_off;
@@ -2017,7 +2022,7 @@ nsc_invalidate(nsc_ctx_t *ctx, char *dbname, nsc_ctx_t **ctxs)
static void
ctx_invalidate(nsc_ctx_t *ctx)
{
- int i;
+ int i;
nsc_entry_t *entry;
char *me = "ctx_invalidate";
@@ -2190,6 +2195,8 @@ reaper(nsc_ctx_t *ctx)
ulong_t nsc_entries;
char *me = "reaper";
+ (void) thr_setname(thr_self(), me);
+
for (;;) {
(void) mutex_lock(&ctx->stats_mutex);
nsc_entries = ctx->stats.entries;