]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Remove NO_THREADS
authorFlorian Weimer <fweimer@redhat.com>
Fri, 19 Feb 2016 16:07:45 +0000 (17:07 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 19 Feb 2016 16:07:45 +0000 (17:07 +0100)
No functional change.  It was not possible to build without
threading support before.

ChangeLog
malloc/arena.c
malloc/malloc.c
sysdeps/generic/malloc-machine.h

index 6658cb5692cff2ea93a7a855223b7367767dc5e9..bad618941c56bb7c26e217696e68a01fed3d244a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-19  Florian Weimer  <fweimer@redhat.com>
+
+       * sysdeps/generic/malloc-machine.h: Assume mutex_init is always
+       available.  Do not define NO_THREADS.
+       * malloc/malloc.c: Do not check NO_THREADS.
+       * malloc/arena.c: Likewise.
+
 2016-02-19  Florian Weimer  <fweimer@redhat.com>
 
        * malloc/malloc.c (__libc_mallinfo): Update comment.
index 54cf0865ea4d0fea152d0abb9b1a4fd93b8e26f9..cd26cdd02c10687f3280450c1d35805dc95b35eb 100644 (file)
@@ -127,8 +127,6 @@ int __malloc_initialized = -1;
 
 /**************************************************************************/
 
-#ifndef NO_THREADS
-
 /* atfork support.  */
 
 static void *(*save_malloc_hook)(size_t __size, const void *);
@@ -327,7 +325,6 @@ ptmalloc_unlock_all2 (void)
 
 #  define ptmalloc_unlock_all2 ptmalloc_unlock_all
 # endif
-#endif  /* !NO_THREADS */
 
 /* Initialization routine. */
 #include <string.h>
index 1038df4864ccfe9038add6b7c92e908c7a17d55d..b8a43bfb32bcd97a6ed468cb7635b4bbfef2e3a2 100644 (file)
@@ -1073,10 +1073,8 @@ static void*   realloc_check(void* oldmem, size_t bytes,
                               const void *caller);
 static void*   memalign_check(size_t alignment, size_t bytes,
                                const void *caller);
-#ifndef NO_THREADS
 static void*   malloc_atfork(size_t sz, const void *caller);
 static void      free_atfork(void* mem, const void *caller);
-#endif
 
 /* ------------------ MMAP support ------------------  */
 
index 1ed2d50a20b7b3442527f07f4c03140148502d7b..71b95c23e9c890d481521e01444572a601ac084c 100644 (file)
 
 #include <atomic.h>
 
-#ifndef mutex_init /* No threads, provide dummy macros */
-
-# define NO_THREADS
-
-/* The mutex functions used to do absolutely nothing, i.e. lock,
-   trylock and unlock would always just return 0.  However, even
-   without any concurrently active threads, a mutex can be used
-   legitimately as an `in use' flag.  To make the code that is
-   protected by a mutex async-signal safe, these macros would have to
-   be based on atomic test-and-set operations, for example. */
-typedef int mutex_t;
-
-# define mutex_init(m)          (*(m) = 0)
-# define mutex_lock(m)          ({ *(m) = 1; 0; })
-# define mutex_trylock(m)       (*(m) ? 1 : ((*(m) = 1), 0))
-# define mutex_unlock(m)        (*(m) = 0)
-
-#endif /* !defined mutex_init */
-
 #ifndef atomic_full_barrier
 # define atomic_full_barrier() __asm ("" ::: "memory")
 #endif