Mercurial > emacs
comparison src/alloc.c @ 72537:07b45e10e844
(BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous
change. Move mutex lock/unlock operations inside BLOCK_INPUT.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Sun, 27 Aug 2006 07:08:31 +0000 |
parents | 428ee64b35d5 |
children | b684c6771753 694bbb62a75d 6823a91487f2 |
comparison
equal
deleted
inserted
replaced
72536:59670fc88353 | 72537:07b45e10e844 |
---|---|
128 static pthread_mutex_t alloc_mutex; | 128 static pthread_mutex_t alloc_mutex; |
129 | 129 |
130 #define BLOCK_INPUT_ALLOC \ | 130 #define BLOCK_INPUT_ALLOC \ |
131 do \ | 131 do \ |
132 { \ | 132 { \ |
133 if (!in_sighandler) \ | 133 if (pthread_self () == main_thread) \ |
134 { \ | 134 BLOCK_INPUT; \ |
135 pthread_mutex_lock (&alloc_mutex); \ | 135 pthread_mutex_lock (&alloc_mutex); \ |
136 if (pthread_self () == main_thread) \ | |
137 BLOCK_INPUT; \ | |
138 else \ | |
139 sigblock (sigmask (SIGIO)); \ | |
140 } \ | |
141 } \ | 136 } \ |
142 while (0) | 137 while (0) |
143 #define UNBLOCK_INPUT_ALLOC \ | 138 #define UNBLOCK_INPUT_ALLOC \ |
144 do \ | 139 do \ |
145 { \ | 140 { \ |
146 if (!in_sighandler) \ | 141 pthread_mutex_unlock (&alloc_mutex); \ |
147 { \ | 142 if (pthread_self () == main_thread) \ |
148 pthread_mutex_unlock (&alloc_mutex); \ | 143 UNBLOCK_INPUT; \ |
149 if (pthread_self () == main_thread) \ | |
150 UNBLOCK_INPUT; \ | |
151 else \ | |
152 sigunblock (sigmask (SIGIO)); \ | |
153 } \ | |
154 } \ | 144 } \ |
155 while (0) | 145 while (0) |
156 | 146 |
157 #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | 147 #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ |
158 | 148 |