summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2015-11-24 16:37:15 +0100
committerFlorian Weimer <fweimer@redhat.com>2015-11-24 16:37:15 +0100
commit400e12265d99964f8445bb6d717321eb73152cc5 (patch)
tree6473ade0eedb0503e4716ff79d50dc091a63e6ab /malloc
parenta61a1a2576e82c7a0c5de620b2eda755edeffb88 (diff)
downloadglibc-400e12265d99964f8445bb6d717321eb73152cc5.tar.gz
glibc-400e12265d99964f8445bb6d717321eb73152cc5.tar.xz
glibc-400e12265d99964f8445bb6d717321eb73152cc5.zip
Replace MUTEX_INITIALIZER with _LIBC_LOCK_INITIALIZER in generic code
	* sysdeps/mach/hurd/libc-lock.h (_LIBC_LOCK_INITIALIZER): Define.
	(__libc_lock_define_initialized): Use it.
	* sysdeps/nptl/libc-lockP.h (_LIBC_LOCK_INITIALIZER): Define.
	* malloc/arena.c (list_lock): Use _LIBC_LOCK_INITIALIZER.
	* malloc/malloc.c (main_arena): Likewise.
	* sysdeps/generic/malloc-machine.h (MUTEX_INITIALIZER): Remove.
	* sysdeps/nptl/malloc-machine.h (MUTEX_INITIALIZER): Remove.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c2
-rw-r--r--malloc/malloc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 0f00afaf22..3dab7bb297 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -73,7 +73,7 @@ static __thread mstate thread_arena attribute_tls_model_ie;
    objects.  No other (malloc) locks must be taken while list_lock is
    active, otherwise deadlocks may occur.  */
 
-static mutex_t list_lock = MUTEX_INITIALIZER;
+static mutex_t list_lock = _LIBC_LOCK_INITIALIZER;
 static size_t narenas = 1;
 static mstate free_list;
 
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 839263efc5..a030109c3e 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1760,7 +1760,7 @@ struct malloc_par
 
 static struct malloc_state main_arena =
 {
-  .mutex = MUTEX_INITIALIZER,
+  .mutex = _LIBC_LOCK_INITIALIZER,
   .next = &main_arena,
   .attached_threads = 1
 };