diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-01-31 12:11:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-01-31 12:11:10 +0000 |
commit | 4d06461a76587c80359f6db5e1c6e4f4641d2663 (patch) | |
tree | 50f8b63101860d3e414a4b1276e49c8e26469453 /nscd/pwdcache.c | |
parent | d67281a7eac124e2f1b498c377dde3432f711039 (diff) | |
download | glibc-4d06461a76587c80359f6db5e1c6e4f4641d2663.zip glibc-4d06461a76587c80359f6db5e1c6e4f4641d2663.tar.gz glibc-4d06461a76587c80359f6db5e1c6e4f4641d2663.tar.bz2 |
Update.
1998-01-31 20:52 Ulrich Drepper <drepper@cygnus.com>
* nscd/grpcache.c (cache_grpinit): Let calloc do the multiplication.
* nscd/pwdcache.c (cache_pwdinit): Use thread attribute to detach
thread and no pthread_detach.
* nscd/nscd.c: Rewrite to use argp instead of getopt.
* config.make.in: Likewise.
Diffstat (limited to 'nscd/pwdcache.c')
-rw-r--r-- | nscd/pwdcache.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c index a367666..82a26ef 100644 --- a/nscd/pwdcache.c +++ b/nscd/pwdcache.c @@ -103,6 +103,7 @@ set_neg_pwd_ttl (unsigned long int ttl) int cache_pwdinit () { + pthread_attr_t attr; pthread_t thread; pwdtbl = calloc (modulo, sizeof (pwdhash)); @@ -115,10 +116,14 @@ cache_pwdinit () if (negtbl == NULL) return -1; - pthread_create (&thread, NULL, pwdtable_update, (void *)NULL); - pthread_detach (thread); - pthread_create (&thread, NULL, negtable_update, (void *)NULL); - pthread_detach (thread); + pthread_attr_init (&attr); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + + pthread_create (&thread, NULL, pwdtable_update, &attr); + pthread_create (&thread, NULL, negtable_update, &attr); + + pthread_attr_destroy (&attr); + return 0; } |