summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2006-08-10 06:09:30 +0000
committerJan Djärv <jan.h.d@swipnet.se>2006-08-10 06:09:30 +0000
commit0d3e774694d20e3cf496204fad3447bac9f13d55 (patch)
tree379ebe6f356b6387e886ffa502e473738ee9b859 /src/alloc.c
parent90b03d58966b9bb4f8de4f4b5fcbb24cec70b45a (diff)
downloademacs-0d3e774694d20e3cf496204fad3447bac9f13d55.tar.gz
* alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler
to check if mutex should be locked or not.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index eb7acfd649f..192b974196f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -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)