aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2008-04-12 01:59:22 +0000
committerYAMAMOTO Mitsuharu2008-04-12 01:59:22 +0000
commita1b41389e4069747940c87b477f11852ec86d9f3 (patch)
treece00e07f955490e97cf81b037252687acdc0f11b /src/alloc.c
parent4cbb903fcb853c42b32a4101f03dc3c56077b35f (diff)
downloademacs-a1b41389e4069747940c87b477f11852ec86d9f3.tar.gz
emacs-a1b41389e4069747940c87b477f11852ec86d9f3.zip
[!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
[HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.
Diffstat (limited to 'src/alloc.c')
-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
1356uninterrupt_malloc () 1356uninterrupt_malloc ()
1357{ 1357{
1358#ifdef HAVE_GTK_AND_PTHREAD 1358#ifdef HAVE_GTK_AND_PTHREAD
1359#ifdef DOUG_LEA_MALLOC
1359 pthread_mutexattr_t attr; 1360 pthread_mutexattr_t attr;
1360 1361
1361 /* GLIBC has a faster way to do this, but lets keep it portable. 1362 /* GLIBC has a faster way to do this, but lets keep it portable.
@@ -1363,6 +1364,11 @@ uninterrupt_malloc ()
1363 pthread_mutexattr_init (&attr); 1364 pthread_mutexattr_init (&attr);
1364 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); 1365 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
1365 pthread_mutex_init (&alloc_mutex, &attr); 1366 pthread_mutex_init (&alloc_mutex, &attr);
1367#else /* !DOUG_LEA_MALLOC */
1368 /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
1369 and the bundled gmalloc.c doesn't require it. */
1370 pthread_mutex_init (&alloc_mutex, NULL);
1371#endif /* !DOUG_LEA_MALLOC */
1366#endif /* HAVE_GTK_AND_PTHREAD */ 1372#endif /* HAVE_GTK_AND_PTHREAD */
1367 1373
1368 if (__free_hook != emacs_blocked_free) 1374 if (__free_hook != emacs_blocked_free)