Mercurial > emacs
comparison src/syssignal.h @ 94959:d2b202fafd8c
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1159
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 14 May 2008 04:28:51 +0000 |
parents | 107ccd98fa12 32bd922619ad |
children | 29adfc9354e7 |
comparison
equal
deleted
inserted
replaced
94958:2ad9b7089844 | 94959:d2b202fafd8c |
---|---|
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 Boston, MA 02110-1301, USA. */ | 20 Boston, MA 02110-1301, USA. */ |
21 | 21 |
22 extern void init_signals P_ ((void)); | 22 extern void init_signals P_ ((void)); |
23 | 23 |
24 #ifdef HAVE_GTK_AND_PTHREAD | 24 #if defined (HAVE_GTK_AND_PTHREAD) || (defined (HAVE_CARBON) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020) |
25 #include <pthread.h> | 25 #include <pthread.h> |
26 /* If defined, asynchronous signals delivered to a non-main thread are | |
27 forwarded to the main thread. */ | |
28 #define FORWARD_SIGNAL_TO_MAIN_THREAD | |
29 #endif | |
30 | |
31 #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD | |
26 extern pthread_t main_thread; | 32 extern pthread_t main_thread; |
27 #endif | 33 #endif |
28 | 34 |
29 #ifdef POSIX_SIGNALS | 35 #ifdef POSIX_SIGNALS |
30 | 36 |
206 #ifndef HAVE_STRSIGNAL | 212 #ifndef HAVE_STRSIGNAL |
207 /* strsignal is in sysdep.c */ | 213 /* strsignal is in sysdep.c */ |
208 char *strsignal (); | 214 char *strsignal (); |
209 #endif | 215 #endif |
210 | 216 |
211 #ifdef HAVE_GTK_AND_PTHREAD | 217 #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD |
212 #define SIGNAL_THREAD_CHECK(signo) \ | 218 #define SIGNAL_THREAD_CHECK(signo) \ |
213 do { \ | 219 do { \ |
214 if (!pthread_equal (pthread_self (), main_thread)) \ | 220 if (!pthread_equal (pthread_self (), main_thread)) \ |
215 { \ | 221 { \ |
216 /* POSIX says any thread can receive the signal. On GNU/Linux \ | 222 /* POSIX says any thread can receive the signal. On GNU/Linux \ |
225 pthread_kill (main_thread, signo); \ | 231 pthread_kill (main_thread, signo); \ |
226 return; \ | 232 return; \ |
227 } \ | 233 } \ |
228 } while (0) | 234 } while (0) |
229 | 235 |
230 #else /* not HAVE_GTK_AND_PTHREAD */ | 236 #else /* not FORWARD_SIGNAL_TO_MAIN_THREAD */ |
231 #define SIGNAL_THREAD_CHECK(signo) | 237 #define SIGNAL_THREAD_CHECK(signo) |
232 #endif /* not HAVE_GTK_AND_PTHREAD */ | 238 #endif /* not FORWARD_SIGNAL_TO_MAIN_THREAD */ |
233 /* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152 | 239 /* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152 |
234 (do not change this comment) */ | 240 (do not change this comment) */ |