diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-07-03 23:20:55 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-07-03 23:20:55 -0700 |
commit | 2c1c974b061b14ec69b29c436214b0350872f14c (patch) | |
tree | 7b21efad2e4b150316f7b34552579a2a4490a06d /src/emacs.c | |
parent | 8b09455e9cc38c741183469b3381b67254472fe5 (diff) | |
download | emacs-2c1c974b061b14ec69b29c436214b0350872f14c.tar.gz |
Try again to fix FreeBSD bug re multithreaded memory alloc.
* emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Do not clear _malloc_thread_enabled_p, undoing the previous change,
which did not work (see <http://bugs.gnu.org/14569#307>).
(main): Do not invoke malloc_enable_thread if (! CANNOT_DUMP
&& (!noninteractive || initialized)). This attempts to thread
the needle between the Scylla of FreeBSD and the Charybdis of Cygwin.
Diffstat (limited to 'src/emacs.c')
-rw-r--r-- | src/emacs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/emacs.c b/src/emacs.c index bebc5e420ad..4b709527ff0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -128,7 +128,6 @@ extern int malloc_set_state (void*); dumping. Used to work around a bug in glibc's malloc. */ static bool malloc_using_checking; #elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC -extern int _malloc_thread_enabled_p; extern void malloc_enable_thread (void); #endif @@ -682,12 +681,6 @@ main (int argc, char **argv) stack_base = &dummy; #endif -#if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC - /* Disable mutexes in gmalloc.c. Otherwise, FreeBSD Emacs recursively - loops with pthread_mutex_lock calling calloc and vice versa. */ - _malloc_thread_enabled_p = 0; -#endif - #ifdef G_SLICE_ALWAYS_MALLOC /* This is used by the Cygwin build. */ xputenv ("G_SLICE=always-malloc"); @@ -1084,7 +1077,14 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem } #if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC - malloc_enable_thread (); +# ifndef CANNOT_DUMP + /* Do not make gmalloc thread-safe when creating bootstrap-emacs, as + that causes an infinite recursive loop with FreeBSD. But do make + it thread-safe when creating emacs, otherwise bootstrap-emacs + fails on Cygwin. See Bug#14569. */ + if (!noninteractive || initialized) +# endif + malloc_enable_thread (); #endif init_signals (dumping); |