YAMAMOTO Mitsuharu skrev:
On Thu, 10 Aug 2006 10:11:55 +0200, Jan Djärv <[EMAIL PROTECTED]> said:
In this particular case it would help, but in general the problem is
that the signal handler gets called when the main thread is
executing in the mutex code (pthread_mutex_unlock). Later when the
signal handler tries to get the mutex, it locks up,
My intention was that the above scenario would be avoided with
BLOCK_INPUT around functions that may call malloc-related functions.
It does not help if the calling thread is one of the Gnoem threads.
How about just changing the order of lock/unlock and
BLOCK_INPUT/UNBLOCK_INPUT in the previous version of
BLOCK_INPUT_ALLOC/UNBLOCK_INPUT_ALLOC?
#define BLOCK_INPUT_ALLOC \
do \
{ \
if (pthread_self () == main_thread) \
BLOCK_INPUT; \
pthread_mutex_lock (&alloc_mutex); \
} \
while (0)
#define UNBLOCK_INPUT_ALLOC \
do \
{ \
pthread_mutex_unlock (&alloc_mutex); \
if (pthread_self () == main_thread) \
UNBLOCK_INPUT; \
} \
while (0)
That would mean that lock/unlock mutex functions are called in the signal
handler context, which is not allowed according to the documentation.
Jan D.
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug