]> git.eshelyaron.com Git - emacs.git/commitdiff
* alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler
authorJan Djärv <jan.h.d@swipnet.se>
Thu, 10 Aug 2006 06:09:30 +0000 (06:09 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Thu, 10 Aug 2006 06:09:30 +0000 (06:09 +0000)
 to check if mutex should be locked or not.

src/alloc.c

index eb7acfd649ff50f761a67c3e7a5132529ec48c48..192b974196ff3692d8dd5843298c9cb69819a190 100644 (file)
@@ -130,17 +130,27 @@ static pthread_mutex_t alloc_mutex;
 #define BLOCK_INPUT_ALLOC                       \
   do                                            \
     {                                           \
-      pthread_mutex_lock (&alloc_mutex);        \
-      if (pthread_self () == main_thread)       \
-        BLOCK_INPUT;                            \
+      if (!in_sighandler)                       \
+        {                                       \
+           pthread_mutex_lock (&alloc_mutex);   \
+           if (pthread_self () == main_thread)  \
+             BLOCK_INPUT;                       \
+           else                                 \
+             sigblock (sigmask (SIGIO));        \
+        }                                       \
     }                                           \
   while (0)
 #define UNBLOCK_INPUT_ALLOC                     \
   do                                            \
     {                                           \
-      if (pthread_self () == main_thread)       \
-        UNBLOCK_INPUT;                          \
-      pthread_mutex_unlock (&alloc_mutex);      \
+      if (!in_sighandler)                       \
+        {                                       \
+           pthread_mutex_unlock (&alloc_mutex); \
+           if (pthread_self () == main_thread)  \
+             UNBLOCK_INPUT;                     \
+           else                                 \
+             sigunblock (sigmask (SIGIO));      \
+        }                                       \
     }                                           \
   while (0)