changeset 75192:a62f8b0494a2

(BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal, block/unblock SIGIO.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 11 Jan 2007 19:21:53 +0000
parents 98ad9ce30ba1
children 71763661a76e
files src/alloc.c
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Thu Jan 11 16:52:59 2007 +0000
+++ b/src/alloc.c	Thu Jan 11 19:21:53 2007 +0000
@@ -127,21 +127,21 @@
 
 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 */