diff options
| author | Jan Djärv | 2006-08-10 06:09:30 +0000 |
|---|---|---|
| committer | Jan Djärv | 2006-08-10 06:09:30 +0000 |
| commit | 0d3e774694d20e3cf496204fad3447bac9f13d55 (patch) | |
| tree | 379ebe6f356b6387e886ffa502e473738ee9b859 /src/alloc.c | |
| parent | 90b03d58966b9bb4f8de4f4b5fcbb24cec70b45a (diff) | |
| download | emacs-0d3e774694d20e3cf496204fad3447bac9f13d55.tar.gz emacs-0d3e774694d20e3cf496204fad3447bac9f13d55.zip | |
* 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.c | 22 |
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; | |||
| 130 | #define BLOCK_INPUT_ALLOC \ | 130 | #define BLOCK_INPUT_ALLOC \ |
| 131 | do \ | 131 | do \ |
| 132 | { \ | 132 | { \ |
| 133 | pthread_mutex_lock (&alloc_mutex); \ | 133 | if (!in_sighandler) \ |
| 134 | if (pthread_self () == main_thread) \ | 134 | { \ |
| 135 | BLOCK_INPUT; \ | 135 | pthread_mutex_lock (&alloc_mutex); \ |
| 136 | if (pthread_self () == main_thread) \ | ||
| 137 | BLOCK_INPUT; \ | ||
| 138 | else \ | ||
| 139 | sigblock (sigmask (SIGIO)); \ | ||
| 140 | } \ | ||
| 136 | } \ | 141 | } \ |
| 137 | while (0) | 142 | while (0) |
| 138 | #define UNBLOCK_INPUT_ALLOC \ | 143 | #define UNBLOCK_INPUT_ALLOC \ |
| 139 | do \ | 144 | do \ |
| 140 | { \ | 145 | { \ |
| 141 | if (pthread_self () == main_thread) \ | 146 | if (!in_sighandler) \ |
| 142 | UNBLOCK_INPUT; \ | 147 | { \ |
| 143 | pthread_mutex_unlock (&alloc_mutex); \ | 148 | pthread_mutex_unlock (&alloc_mutex); \ |
| 149 | if (pthread_self () == main_thread) \ | ||
| 150 | UNBLOCK_INPUT; \ | ||
| 151 | else \ | ||
| 152 | sigunblock (sigmask (SIGIO)); \ | ||
| 153 | } \ | ||
| 144 | } \ | 154 | } \ |
| 145 | while (0) | 155 | while (0) |
| 146 | 156 | ||