Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 2003d1abfa0c20ee77815f0da33e2c1c > files > 119

glibc-2.5-49.el5_5.5.src.rpm

2009-07-16  Ulrich Drepper  <drepper@redhat.com>

	* nscd/cache.c (cache_add): Use atomic_compare_and_exchange_bool_rel
	instead of atomic_compare_and_exchange_bool_acq to ensure pointer
	is written before the list head update.
	Patch by Andreas Schwab <aschwab@redhat.com>.

--- libc/nscd/cache.c
+++ libc/nscd/cache.c
@@ -179,7 +179,7 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
   /* Put the new entry in the first position.  */
   do
     newp->next = table->head->array[hash];
-  while (atomic_compare_and_exchange_bool_acq (&table->head->array[hash],
+  while (atomic_compare_and_exchange_bool_rel (&table->head->array[hash],
 					       (ref_t) ((char *) newp
 							- table->data),
 					       (ref_t) newp->next));