From e9b3e3c5ceec61f6af401b122434844321960eec Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 10 Dec 1999 04:37:40 +0000 Subject: Update. 1999-12-09 Andreas Jaeger * nis/nss_compat/compat-pwd.c (internal_getpwuid_r): Always set errno to ENOENT when returning NSS_STATUS_NOTFOUND. Reported by Christian Starkjohann . 1999-12-09 Andreas Jaeger * sysdeps/i386/fpu/libm-test-ulps: Added some ulps. 1999-12-09 Jakub Jelinek * stdlib/longlong.h: Update from latest egcs version. * sysdeps/sparc/fpu/fegetenv.c: Add semicolons. * sysdeps/unix/sysv/linux/bits/errno.h (__errno_location): __THROW has to preceede __attribute__, otherwise g++ barfs. * sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Make things compile on sparc64-*-linux. * sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h: Changed to use sigcontext. * sysdeps/unix/sysv/linux/sparc/sparc64/sigcontextinfo.h: Likewise. 1999-12-05 Wolfram Gloger * malloc/malloc.c (arena_get2): If generating a new arena fails, try to generate a minimal one and hope for mmap_chunk() to succeed later. 1999-11-07 Wolfram Gloger * malloc/thread-m.h [NO_THREADS]: The mutex_* macros now let mutex_t work as an `in-use' flag even without threads. * malloc/malloc.c (USE_ARENAS): New feature flag, controls support for multiple arenas separately from NO_THREADS. (mALLOc, chunk_realloc, mEMALIGn, cALLOc) [USE_ARENAS]: try to fall back to an mmap()ed arena when sbrk() has failed. --- malloc/thread-m.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'malloc/thread-m.h') diff --git a/malloc/thread-m.h b/malloc/thread-m.h index 1598db8ee7..d5b1e2f4b0 100644 --- a/malloc/thread-m.h +++ b/malloc/thread-m.h @@ -207,18 +207,24 @@ int tsd_key_next; typedef int thread_id; +/* 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_INITIALIZER 0 #define mutex_init(m) (*(m) = 0) -#define mutex_lock(m) (0) -#define mutex_trylock(m) (0) -#define mutex_unlock(m) (0) +#define mutex_lock(m) ((*(m) = 1), 0) +#define mutex_trylock(m) (*(m) ? 1 : ((*(m) = 1), 0)) +#define mutex_unlock(m) (*(m) = 0) typedef void *tsd_key_t; #define tsd_key_create(key, destr) do {} while(0) -#define tsd_setspecific(key, data) do {} while(0) -#define tsd_getspecific(key, vptr) (vptr = NULL) +#define tsd_setspecific(key, data) ((key) = (data)) +#define tsd_getspecific(key, vptr) (vptr = (key)) #define thread_atfork(prepare, parent, child) do {} while(0) -- cgit 1.4.1