Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
@@ -20,10 +20,11 @@
*/
/*
* 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.
*/
/*
* Cache routines for nscd
*/
@@ -1815,10 +1816,12 @@
static void
revalidate(nsc_ctx_t *ctx)
{
+ (void) thr_setname(thr_self(), "revalidate");
+
for (;;) {
int i, slp, interval, count;
(void) rw_rdlock(&ctx->cfg_rwlp);
slp = ctx->cfg.pos_ttl;
@@ -1959,10 +1962,12 @@
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;
(void) lookup_int(in, UPDATEBIT);
if (in->buffer)
@@ -2188,10 +2193,12 @@
uint_t ttl, extra_sleep, total_sleep, intervals;
uint_t nodes_per_interval, seconds_per_interval;
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;
(void) mutex_unlock(&ctx->stats_mutex);