]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 1 Jul 2003 08:31:38 +0000 (08:31 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 1 Jul 2003 08:31:38 +0000 (08:31 +0000)
2003-05-04  H.J. Lu  <hongjiu.lu@intel.com>

* malloc/arena.c (arena_get2): Add atomic_write_barrier.
* malloc/thread-m.h: Include <atomic.h>.
(atomic_full_barrier): Provide default.
(atomic_read_barrier): Likewise.
(atomic_write_barrier): Likewise.
* sysdeps/ia64/bits/atomic.h (atomic_full_barrier): New #define.

ChangeLog
malloc/arena.c
malloc/thread-m.h
sysdeps/ia64/bits/atomic.h

index 2ba482f0311467e592af36ee71c35a228c7211ef..ac480dcbcb4fde3dd98d176a7561c5a363d2d41d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * malloc/arena.c (arena_get2): Add atomic_write_barrier.
+       * malloc/thread-m.h: Include <atomic.h>.
+       (atomic_full_barrier): Provide default.
+       (atomic_read_barrier): Likewise.
+       (atomic_write_barrier): Likewise.
+       * sysdeps/ia64/bits/atomic.h (atomic_full_barrier): New #define.
+
 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/generic/sysdep.h: Define cfi_rel_offset and CFI_REL_OFFSET.
index e47d3d0e1f56e0d876cf3e4bdf8f326417979819..fb7b92f31858568d8c71c3d3f2cd33212cb950e9 100644 (file)
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
 
@@ -758,6 +758,7 @@ arena_get2(a_tsd, size) mstate a_tsd; size_t size;
   /* Add the new arena to the global list.  */
   (void)mutex_lock(&list_lock);
   a->next = main_arena.next;
+  atomic_write_barrier ();
   main_arena.next = a;
   (void)mutex_unlock(&list_lock);
 
index da8bbf36f813fb27f6b48fc2143dd64a62c29e46..1dcaed05142553963ef0aa0e02df9392d21228bb 100644 (file)
@@ -31,6 +31,7 @@
 
 #if defined(_LIBC) /* The GNU C library, a special case of Posix threads */
 
+#include <atomic.h>
 #include <bits/libc-lock.h>
 
 #ifdef PTHREAD_MUTEX_INITIALIZER
@@ -306,4 +307,16 @@ typedef void *tsd_key_t;
 
 #endif /* defined(NO_THREADS) */
 
+#ifndef atomic_full_barrier
+# define atomic_full_barrier() __asm ("" ::: "memory")
+#endif
+
+#ifndef atomic_read_barrier
+# define atomic_read_barrier() atomic_full_barrier ()
+#endif
+
+#ifndef atomic_write_barrier
+# define atomic_write_barrier() atomic_full_barrier ()
+#endif
+
 #endif /* !defined(_THREAD_M_H) */
index 27346675ab9d546ebee2749d3c9ce43fdf8d1497..c8b567b69c9c769c7273c41ce3f759fd54033a24 100644 (file)
@@ -122,3 +122,5 @@ typedef uintmax_t uatomic_max_t;
        }                                                                     \
      while (__builtin_expect (__val != __oldval, 0));                        \
      __oldval & __mask; })
+
+#define atomic_full_barrier() __sync_synchronize ()
This page took 0.057213 seconds and 5 git commands to generate.