comparison src/alloc.c @ 94293:ca9efc5939fc

Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1121
author Miles Bader <miles@gnu.org>
date Wed, 23 Apr 2008 05:55:42 +0000
parents 4d9fc08769fa 07f3d63ad3d3
children 8971ddf55736
comparison
equal deleted inserted replaced
94292:f07af351ed0b 94293:ca9efc5939fc
1364 1364
1365 void 1365 void
1366 uninterrupt_malloc () 1366 uninterrupt_malloc ()
1367 { 1367 {
1368 #ifdef HAVE_GTK_AND_PTHREAD 1368 #ifdef HAVE_GTK_AND_PTHREAD
1369 #ifdef DOUG_LEA_MALLOC
1369 pthread_mutexattr_t attr; 1370 pthread_mutexattr_t attr;
1370 1371
1371 /* GLIBC has a faster way to do this, but lets keep it portable. 1372 /* GLIBC has a faster way to do this, but lets keep it portable.
1372 This is according to the Single UNIX Specification. */ 1373 This is according to the Single UNIX Specification. */
1373 pthread_mutexattr_init (&attr); 1374 pthread_mutexattr_init (&attr);
1374 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); 1375 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
1375 pthread_mutex_init (&alloc_mutex, &attr); 1376 pthread_mutex_init (&alloc_mutex, &attr);
1377 #else /* !DOUG_LEA_MALLOC */
1378 /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
1379 and the bundled gmalloc.c doesn't require it. */
1380 pthread_mutex_init (&alloc_mutex, NULL);
1381 #endif /* !DOUG_LEA_MALLOC */
1376 #endif /* HAVE_GTK_AND_PTHREAD */ 1382 #endif /* HAVE_GTK_AND_PTHREAD */
1377 1383
1378 if (__free_hook != emacs_blocked_free) 1384 if (__free_hook != emacs_blocked_free)
1379 old_free_hook = __free_hook; 1385 old_free_hook = __free_hook;
1380 __free_hook = emacs_blocked_free; 1386 __free_hook = emacs_blocked_free;