diff options
| author | Eli Zaretskii | 2016-12-30 11:36:07 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-30 11:36:07 +0200 |
| commit | 543532313a1d9570d6a74a7846b4e776a2282964 (patch) | |
| tree | 72b0fc8e8fb161f04af620ef14a02836ad672791 /src/process.c | |
| parent | d9b126890dd729e18cb5522c38f33fc70daadd79 (diff) | |
| download | emacs-543532313a1d9570d6a74a7846b4e776a2282964.tar.gz emacs-543532313a1d9570d6a74a7846b4e776a2282964.zip | |
Attempt to fix crashes with threads in GTK builds
* src/xgselect.c (xg_select): Call pselect via thread_select, not
directly, to avoid running Lisp (via unblock_input) when more than
one thread could be running. (Bug#25247)
* src/process.c (wait_reading_process_output) [HAVE_GLIB]: Call
xg_select directly instead of through thread_select.
* src/xgselect.h (xg_select): Last 2 arguments are no longer
'const', for consistency with thread_select.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c index c5a46f992d7..c0c52c232b9 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5341,18 +5341,23 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5341 | } | 5341 | } |
| 5342 | #endif | 5342 | #endif |
| 5343 | 5343 | ||
| 5344 | /* HAVE_GLIB builds call thread_select in xgselect.c. */ | ||
| 5345 | #ifdef HAVE_GLIB | ||
| 5346 | nfds = xg_select (max_desc + 1, | ||
| 5347 | &Available, (check_write ? &Writeok : 0), | ||
| 5348 | NULL, &timeout, NULL); | ||
| 5349 | #else /* !HAVE_GLIB */ | ||
| 5344 | nfds = thread_select ( | 5350 | nfds = thread_select ( |
| 5345 | #if defined (HAVE_NS) | 5351 | # ifdef HAVE_NS |
| 5346 | ns_select | 5352 | ns_select |
| 5347 | #elif defined (HAVE_GLIB) | 5353 | # else |
| 5348 | xg_select | ||
| 5349 | #else | ||
| 5350 | pselect | 5354 | pselect |
| 5351 | #endif | 5355 | # endif |
| 5352 | , max_desc + 1, | 5356 | , max_desc + 1, |
| 5353 | &Available, | 5357 | &Available, |
| 5354 | (check_write ? &Writeok : 0), | 5358 | (check_write ? &Writeok : 0), |
| 5355 | NULL, &timeout, NULL); | 5359 | NULL, &timeout, NULL); |
| 5360 | #endif /* !HAVE_GLIB */ | ||
| 5356 | 5361 | ||
| 5357 | #ifdef HAVE_GNUTLS | 5362 | #ifdef HAVE_GNUTLS |
| 5358 | /* GnuTLS buffers data internally. In lowat mode it leaves | 5363 | /* GnuTLS buffers data internally. In lowat mode it leaves |