(BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal,
block/unblock SIGIO.
This commit is contained in:
parent
3a349573d8
commit
959dc6015a
2 changed files with 19 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-01-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
|
||||
|
||||
* alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal,
|
||||
block/unblock SIGIO.
|
||||
|
||||
2007-01-10 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* editfns.c (Fformat): Allow integer-format to work with floats of size
|
||||
|
|
28
src/alloc.c
28
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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue