diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/thread.c b/src/thread.c index c03cdda0fae..dd466818ef9 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -573,8 +573,15 @@ really_call_select (void *arg) | |||
| 573 | sa->timeout, sa->sigmask); | 573 | sa->timeout, sa->sigmask); |
| 574 | 574 | ||
| 575 | block_interrupt_signal (&oldset); | 575 | block_interrupt_signal (&oldset); |
| 576 | acquire_global_lock (self); | 576 | /* If we were interrupted by C-g while inside sa->func above, the |
| 577 | self->not_holding_lock = 0; | 577 | signal handler could have called maybe_reacquire_global_lock, in |
| 578 | which case we are already holding the lock and shouldn't try | ||
| 579 | taking it again, or else we will hang forever. */ | ||
| 580 | if (self->not_holding_lock) | ||
| 581 | { | ||
| 582 | acquire_global_lock (self); | ||
| 583 | self->not_holding_lock = 0; | ||
| 584 | } | ||
| 578 | restore_signal_mask (&oldset); | 585 | restore_signal_mask (&oldset); |
| 579 | } | 586 | } |
| 580 | 587 | ||