summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-04-12 01:58:56 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-04-12 01:58:56 +0000
commit0a98e83ad96b129840257843d24684afceabdfdf (patch)
tree646c20354afc3c3cfe09194ae345e707fcaa799a
parent9333e7d7381cf057964da13f63acc04bc334f0ab (diff)
downloademacs-0a98e83ad96b129840257843d24684afceabdfdf.tar.gz
[!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
[HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.
-rw-r--r--src/alloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 153c54e0264..46887bb332c 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1356,6 +1356,7 @@ void
uninterrupt_malloc ()
{
#ifdef HAVE_GTK_AND_PTHREAD
+#ifdef DOUG_LEA_MALLOC
pthread_mutexattr_t attr;
/* GLIBC has a faster way to do this, but lets keep it portable.
@@ -1363,6 +1364,11 @@ uninterrupt_malloc ()
pthread_mutexattr_init (&attr);
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&alloc_mutex, &attr);
+#else /* !DOUG_LEA_MALLOC */
+ /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
+ and the bundled gmalloc.c doesn't require it. */
+ pthread_mutex_init (&alloc_mutex, NULL);
+#endif /* !DOUG_LEA_MALLOC */
#endif /* HAVE_GTK_AND_PTHREAD */
if (__free_hook != emacs_blocked_free)