6780 |
#ifdef BSD4_1 |
#ifdef BSD4_1 |
6781 |
extern int select_alarmed; |
extern int select_alarmed; |
6782 |
#endif |
#endif |
|
#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) |
|
|
extern pthread_t main_thread; |
|
|
if (pthread_self () != main_thread) |
|
|
{ |
|
|
/* POSIX says any thread can receive the signal. On GNU/Linux that is |
|
|
not true, but for other systems (FreeBSD at least) it is. So direct |
|
|
the signal to the correct thread and block it from this thread. */ |
|
|
#ifdef SIGIO |
|
|
sigset_t new_mask; |
|
|
|
|
|
sigemptyset (&new_mask); |
|
|
sigaddset (&new_mask, SIGIO); |
|
|
pthread_sigmask (SIG_BLOCK, &new_mask, 0); |
|
|
pthread_kill (main_thread, SIGIO); |
|
|
#endif |
|
|
return; |
|
|
} |
|
|
#endif |
|
6783 |
|
|
6784 |
interrupt_input_pending = 0; |
interrupt_input_pending = 0; |
6785 |
|
|
6808 |
{ |
{ |
6809 |
/* Must preserve main program's value of errno. */ |
/* Must preserve main program's value of errno. */ |
6810 |
int old_errno = errno; |
int old_errno = errno; |
|
#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) |
|
|
extern pthread_t main_thread; |
|
|
if (pthread_self () != main_thread) |
|
|
{ |
|
|
/* POSIX says any thread can receive the signal. On GNU/Linux that is |
|
|
not true, but for other systems (FreeBSD at least) it is. So direct |
|
|
the signal to the correct thread and block it from this thread. */ |
|
|
sigset_t new_mask; |
|
|
|
|
|
sigemptyset (&new_mask); |
|
|
sigaddset (&new_mask, SIGIO); |
|
|
pthread_sigmask (SIG_BLOCK, &new_mask, 0); |
|
|
pthread_kill (main_thread, SIGIO); |
|
|
return; |
|
|
} |
|
|
#endif /* HAVE_GTK_AND_PTHREAD */ |
|
6811 |
#if defined (USG) && !defined (POSIX_SIGNALS) |
#if defined (USG) && !defined (POSIX_SIGNALS) |
6812 |
/* USG systems forget handlers when they are used; |
/* USG systems forget handlers when they are used; |
6813 |
must reestablish each time */ |
must reestablish each time */ |
6824 |
#ifdef SYNC_INPUT |
#ifdef SYNC_INPUT |
6825 |
interrupt_input_pending = 1; |
interrupt_input_pending = 1; |
6826 |
#else |
#else |
6827 |
|
|
6828 |
|
# if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) |
6829 |
|
extern pthread_t main_thread; |
6830 |
|
if (pthread_self () != main_thread) |
6831 |
|
{ |
6832 |
|
/* POSIX says any thread can receive the signal. On GNU/Linux that is |
6833 |
|
not true, but for other systems (FreeBSD at least) it is. So direct |
6834 |
|
the signal to the correct thread and block it from this thread. */ |
6835 |
|
sigset_t new_mask; |
6836 |
|
|
6837 |
|
sigemptyset (&new_mask); |
6838 |
|
sigaddset (&new_mask, SIGIO); |
6839 |
|
pthread_sigmask (SIG_BLOCK, &new_mask, 0); |
6840 |
|
pthread_kill (main_thread, SIGIO); |
6841 |
|
return; |
6842 |
|
} |
6843 |
|
# endif /* HAVE_GTK_AND_PTHREAD */ |
6844 |
|
|
6845 |
handle_async_input (); |
handle_async_input (); |
6846 |
#endif |
#endif |
6847 |
|
|