diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/thread.c b/src/thread.c index c03cdda0fae..1ded8f55f50 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -97,7 +97,12 @@ post_acquire_global_lock (struct thread_state *self) | |||
| 97 | static void | 97 | static void |
| 98 | acquire_global_lock (struct thread_state *self) | 98 | acquire_global_lock (struct thread_state *self) |
| 99 | { | 99 | { |
| 100 | sys_mutex_lock (&global_lock); | 100 | /* If some Lisp was interrupted by C-g while inside pselect, the |
| 101 | signal handler could have called maybe_reacquire_global_lock, in | ||
| 102 | which case we are already holding the lock and shouldn't try | ||
| 103 | taking it again, or else we will hang forever. */ | ||
| 104 | if (!(self && self->not_holding_lock)) | ||
| 105 | sys_mutex_lock (&global_lock); | ||
| 101 | post_acquire_global_lock (self); | 106 | post_acquire_global_lock (self); |
| 102 | } | 107 | } |
| 103 | 108 | ||