From 959dc6015aa5cabb19bda9d29b69772298038a2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 11 Jan 2007 19:22:04 +0000 Subject: [PATCH] (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, block/unblock SIGIO. --- src/ChangeLog | 5 +++++ src/alloc.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1974d45dd2c..821eb25f6cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-01-11 Jan Dj,Ad(Brv + + * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, + block/unblock SIGIO. + 2007-01-10 Stefan Monnier * editfns.c (Fformat): Allow integer-format to work with floats of size diff --git a/src/alloc.c b/src/alloc.c index f3ca3e71a29..926d2706e8f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -127,21 +127,21 @@ extern __malloc_size_t __malloc_extra_blocks; static pthread_mutex_t alloc_mutex; -#define BLOCK_INPUT_ALLOC \ - do \ - { \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ - pthread_mutex_lock (&alloc_mutex); \ - } \ +#define BLOCK_INPUT_ALLOC \ + do \ + { \ + if (pthread_equal (pthread_self (), main_thread)) \ + sigblock (sigmask (SIGIO)); \ + pthread_mutex_lock (&alloc_mutex); \ + } \ while (0) -#define UNBLOCK_INPUT_ALLOC \ - do \ - { \ - pthread_mutex_unlock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - } \ +#define UNBLOCK_INPUT_ALLOC \ + do \ + { \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_equal (pthread_self (), main_thread)) \ + sigunblock (sigmask (SIGIO)); \ + } \ while (0) #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ -- 2.39.2