]> code.delx.au - gnu-emacs/commitdiff
[!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 12 Apr 2008 01:59:22 +0000 (01:59 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 12 Apr 2008 01:59:22 +0000 (01:59 +0000)
[HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.

src/ChangeLog
src/alloc.c

index 0dabe60be18cd446a1032d3f7c702d17e8a80ec3..56676ea95d6d2f15f0a30cb38a8119c950e58dcb 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
+       [HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.
+
 2008-04-11  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * puresize.h (BASE_PURESIZE): Increase to 1140000.
index 153c54e02649c8f138d1ef17b4dd024f14f2c14e..46887bb332c881bb451853408e9c58a47ee89486 100644 (file)
@@ -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)