Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

*** 20,29 **** --- 20,30 ---- */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright 2018 Joyent, Inc. */ #include <stdlib.h> #include <alloca.h> #include <signal.h>
*** 87,96 **** --- 88,99 ---- static void * server_tsd_bind(void *arg) { static void *value = 0; + (void) thr_setname(thr_self(), "server_tsd_bind"); + /* disable cancellation to avoid hangs if server threads disappear */ (void) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); (void) thr_setspecific(server_key, value); (void) door_return(NULL, 0, NULL, 0);
*** 130,140 **** /* * get clearance */ int ! _nscd_get_clearance(sema_t *sema) { if (sema_trywait(&common_sema) == 0) { (void) thr_setspecific(lookup_state_key, NULL); return (0); } --- 133,144 ---- /* * get clearance */ int ! _nscd_get_clearance(sema_t *sema) ! { if (sema_trywait(&common_sema) == 0) { (void) thr_setspecific(lookup_state_key, NULL); return (0); }
*** 149,159 **** /* * release clearance */ int ! _nscd_release_clearance(sema_t *sema) { int which; (void) thr_getspecific(lookup_state_key, (void**)&which); if (which == 0) /* from common pool */ { (void) sema_post(&common_sema); --- 153,164 ---- /* * release clearance */ int ! _nscd_release_clearance(sema_t *sema) ! { int which; (void) thr_getspecific(lookup_state_key, (void**)&which); if (which == 0) /* from common pool */ { (void) sema_post(&common_sema);
*** 1475,1484 **** --- 1480,1491 ---- struct ifa_msghdr ifam; } mbuf; struct ifa_msghdr *ifam = &mbuf.ifam; char *me = "rts_mon"; + (void) thr_setname(thr_self(), me); + rt_sock = socket(PF_ROUTE, SOCK_RAW, 0); if (rt_sock < 0) { _NSCD_LOG(NSCD_LOG_FRONT_END, NSCD_LOG_LEVEL_ERROR) (me, "Failed to open routing socket: %s\n", strerror(errno)); thr_exit(0);