summaryrefslogtreecommitdiff
path: root/sysdeps/generic/malloc-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/malloc-machine.h')
-rw-r--r--sysdeps/generic/malloc-machine.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-machine.h
index 1ed2d50a20..68ca3c7bc4 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,25 +21,7 @@
#define _GENERIC_MALLOC_MACHINE_H
#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 */
+#include <malloc-alignment.h>
#ifndef atomic_full_barrier
# define atomic_full_barrier() __asm ("" ::: "memory")