mirror of git://sourceware.org/git/glibc.git
* nscd/nscd.h (struct database_dyn): Add prunelock field.
* nscd/cache.c (prune_cache): Take prunelock before starting the work. Just return in case it is already taken. (inet6_option_alloc): Now a simple wrapper around option_alloc.
This commit is contained in:
parent
ab50b2ec01
commit
9636a217e4
|
|
@ -1,3 +1,9 @@
|
||||||
|
2006-05-29 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/nscd.h (struct database_dyn): Add prunelock field.
|
||||||
|
* nscd/cache.c (prune_cache): Take prunelock before starting the
|
||||||
|
work. Just return in case it is already taken.
|
||||||
|
|
||||||
2006-05-25 Ulrich Drepper <drepper@redhat.com>
|
2006-05-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* nis/nis_removemember.c (nis_removemember): Avoid unnecessary
|
* nis/nis_removemember.c (nis_removemember): Avoid unnecessary
|
||||||
|
|
@ -12,7 +18,7 @@
|
||||||
inet6_option_alloc.
|
inet6_option_alloc.
|
||||||
* inet/inet6_option.c (option_alloc): Renamed from
|
* inet/inet6_option.c (option_alloc): Renamed from
|
||||||
inet6_option_alloc. Made static.
|
inet6_option_alloc. Made static.
|
||||||
(inet6_option_alloc): New a simple wrapper around option_alloc.
|
(inet6_option_alloc): Now a simple wrapper around option_alloc.
|
||||||
(inet6_option_append): Call option_alloc.
|
(inet6_option_append): Call option_alloc.
|
||||||
* include/netinet/in.h: Remove libc_hidden_proto for
|
* include/netinet/in.h: Remove libc_hidden_proto for
|
||||||
inet6_option_alloc.
|
inet6_option_alloc.
|
||||||
|
|
|
||||||
11
nscd/cache.c
11
nscd/cache.c
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
/* Copyright (c) 1998, 1999, 2003-2005, 2006 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||||
|
|
||||||
|
|
@ -198,6 +198,13 @@ prune_cache (struct database_dyn *table, time_t now)
|
||||||
if (cnt == 0)
|
if (cnt == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* This function can be called from the cleanup thread but also in
|
||||||
|
response to an invalidate command. Make sure only one thread is
|
||||||
|
running. No need for the second to wait around. */
|
||||||
|
if (pthread_mutex_trylock (&table->prunelock) != 0)
|
||||||
|
/* Te work is already being done. */
|
||||||
|
return ;
|
||||||
|
|
||||||
/* If we check for the modification of the underlying file we invalidate
|
/* If we check for the modification of the underlying file we invalidate
|
||||||
the entries also in this case. */
|
the entries also in this case. */
|
||||||
if (table->check_file)
|
if (table->check_file)
|
||||||
|
|
@ -455,4 +462,6 @@ prune_cache (struct database_dyn *table, time_t now)
|
||||||
/* Run garbage collection if any entry has been removed or replaced. */
|
/* Run garbage collection if any entry has been removed or replaced. */
|
||||||
if (any)
|
if (any)
|
||||||
gc (table);
|
gc (table);
|
||||||
|
|
||||||
|
pthread_mutex_unlock (&table->prunelock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ typedef enum
|
||||||
struct database_dyn
|
struct database_dyn
|
||||||
{
|
{
|
||||||
pthread_rwlock_t lock;
|
pthread_rwlock_t lock;
|
||||||
|
pthread_mutex_t prunelock;
|
||||||
|
|
||||||
int enabled;
|
int enabled;
|
||||||
int check_file;
|
int check_file;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue