diff options
| author | Stefan Monnier | 2004-12-11 23:43:21 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-12-11 23:43:21 +0000 |
| commit | d7031edcfa7b7567288f23c1feeeb26f141931d5 (patch) | |
| tree | 78b3eba0385e4a9baf227cb4838cae659c545ff7 /src | |
| parent | 9eb8959aaad86b30ab55f74a8d2a2651c41ee7a3 (diff) | |
| download | emacs-d7031edcfa7b7567288f23c1feeeb26f141931d5.tar.gz emacs-d7031edcfa7b7567288f23c1feeeb26f141931d5.zip | |
(handle_async_input): Remove pthread mutex handling.
(input_available_signal): Move pthread thingy to !SYNC_INPUT branch.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 19973edf33d..4203619863b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6780,24 +6780,6 @@ handle_async_input () | |||
| 6780 | #ifdef BSD4_1 | 6780 | #ifdef BSD4_1 |
| 6781 | extern int select_alarmed; | 6781 | extern int select_alarmed; |
| 6782 | #endif | 6782 | #endif |
| 6783 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 6784 | extern pthread_t main_thread; | ||
| 6785 | if (pthread_self () != main_thread) | ||
| 6786 | { | ||
| 6787 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6788 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6789 | the signal to the correct thread and block it from this thread. */ | ||
| 6790 | #ifdef SIGIO | ||
| 6791 | sigset_t new_mask; | ||
| 6792 | |||
| 6793 | sigemptyset (&new_mask); | ||
| 6794 | sigaddset (&new_mask, SIGIO); | ||
| 6795 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6796 | pthread_kill (main_thread, SIGIO); | ||
| 6797 | #endif | ||
| 6798 | return; | ||
| 6799 | } | ||
| 6800 | #endif | ||
| 6801 | 6783 | ||
| 6802 | interrupt_input_pending = 0; | 6784 | interrupt_input_pending = 0; |
| 6803 | 6785 | ||
| @@ -6826,22 +6808,6 @@ input_available_signal (signo) | |||
| 6826 | { | 6808 | { |
| 6827 | /* Must preserve main program's value of errno. */ | 6809 | /* Must preserve main program's value of errno. */ |
| 6828 | int old_errno = errno; | 6810 | int old_errno = errno; |
| 6829 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 6830 | extern pthread_t main_thread; | ||
| 6831 | if (pthread_self () != main_thread) | ||
| 6832 | { | ||
| 6833 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6834 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6835 | the signal to the correct thread and block it from this thread. */ | ||
| 6836 | sigset_t new_mask; | ||
| 6837 | |||
| 6838 | sigemptyset (&new_mask); | ||
| 6839 | sigaddset (&new_mask, SIGIO); | ||
| 6840 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6841 | pthread_kill (main_thread, SIGIO); | ||
| 6842 | return; | ||
| 6843 | } | ||
| 6844 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 6845 | #if defined (USG) && !defined (POSIX_SIGNALS) | 6811 | #if defined (USG) && !defined (POSIX_SIGNALS) |
| 6846 | /* USG systems forget handlers when they are used; | 6812 | /* USG systems forget handlers when they are used; |
| 6847 | must reestablish each time */ | 6813 | must reestablish each time */ |
| @@ -6858,6 +6824,24 @@ input_available_signal (signo) | |||
| 6858 | #ifdef SYNC_INPUT | 6824 | #ifdef SYNC_INPUT |
| 6859 | interrupt_input_pending = 1; | 6825 | interrupt_input_pending = 1; |
| 6860 | #else | 6826 | #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 | |||
| 6861 | handle_async_input (); | 6845 | handle_async_input (); |
| 6862 | #endif | 6846 | #endif |
| 6863 | 6847 | ||