Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f415cacd
Commit
f415cacd
authored
Dec 07, 2004
by
Jan Djärv
Browse files
* alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.
parent
948a35c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
src/ChangeLog
src/ChangeLog
+4
-0
src/alloc.c
src/alloc.c
+17
-0
No files found.
src/ChangeLog
View file @
f415cacd
2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.
2004-12-07 Stefan <monnier@iro.umontreal.ca>
* eval.c (init_eval_once): Increase max_specpdl_size to 1000.
...
...
src/alloc.c
View file @
f415cacd
...
...
@@ -91,6 +91,23 @@ extern __malloc_size_t __malloc_extra_blocks;
#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
/* When GTK uses the file chooser dialog, different backends can be loaded
dynamically. One such a backend is the Gnome VFS backend that gets loaded
if you run Gnome. That backend creates several threads and also allocates
memory with malloc.
If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_*
functions below are called from malloc, there is a chance that one
of these threads preempts the Emacs main thread and the hook variables
end up in a inconsistent state. So we have a mutex to prevent that (note
that the backend handles concurrent access to malloc within its own threads
but Emacs code running in the main thread is not included in that control).
When UNBLOCK_INPUT is called, revoke_input_signal may be called. If this
happens in one of the backend threads we will have two threads that tries
to run Emacs code at once, and the code is not prepared for that.
To prevent that, we only call BLOCK/UNBLOCK from the main thread. */
static
pthread_mutex_t
alloc_mutex
;
pthread_t
main_thread
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment