this is not my day

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL
Index: gtkmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtkmodule.c,v
retrieving revision 1.53.2.9
diff -u -r1.53.2.9 gtkmodule.c
--- gtkmodule.c 2001/08/26 09:21:06     1.53.2.9
+++ gtkmodule.c 2001/10/09 05:12:20
@@ -75,28 +75,32 @@
  * Python/C function; thus, the initial lock count will always be one.
  */
 #  define INITIAL_LOCK_COUNT 1
-#  define PyGTK_BLOCK_THREADS                                              \
-   {                                                                       \
-     gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key));   \
-     if (counter == -INITIAL_LOCK_COUNT) {                                 \
-       PyThreadState *_save;                                               \
-       _save = g_static_private_get(&pythreadstate_key);                   \
-       Py_BLOCK_THREADS;                                                   \
-     }                                                                     \
-     counter++;                                                            \
-     g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL);   \
+#  define PyGTK_BLOCK_THREADS                                                \
+   {                                                                         \
+     if ( !getenv("PYGTK_NO_THREADS") ) {                                    \
+         gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key)); \
+         if (counter == -INITIAL_LOCK_COUNT) {                               \
+           PyThreadState *_save;                                             \
+           _save = g_static_private_get(&pythreadstate_key);                 \
+           Py_BLOCK_THREADS;                                                 \
+         }                                                                   \
+         counter++;                                                          \
+         g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL); \
+      }                                                                      \
    }
 
-#  define PyGTK_UNBLOCK_THREADS                                            \
-   {                                                                       \
-     gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key));   \
-     counter--;                                                            \
-     if (counter == -INITIAL_LOCK_COUNT) {                                 \
-       PyThreadState *_save;                                               \
-       Py_UNBLOCK_THREADS;                                                 \
-       g_static_private_set(&pythreadstate_key, _save, NULL);              \
-     }                                                                     \
-     g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL);   \
+#  define PyGTK_UNBLOCK_THREADS                                              \
+   {                                                                         \
+      if ( !getenv("PYGTK_NO_THREADS") ) {                                   \
+         gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key)); \
+         counter--;                                                          \
+         if (counter == -INITIAL_LOCK_COUNT) {                               \
+           PyThreadState *_save;                                             \
+           Py_UNBLOCK_THREADS;                                               \
+           g_static_private_set(&pythreadstate_key, _save, NULL);            \
+         }                                                                   \
+         g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL); \
+      }                                                                      \
    }
 
 
@@ -7162,7 +7166,7 @@
 #ifdef WITH_THREAD
      /* it is required that this function be called to enable the thread
       * safety functions */
-     if (!g_threads_got_initialized)
+     if ( !g_threads_got_initialized && !getenv("PYGTK_NO_THREADS") )
          g_thread_init(NULL);
 #endif
 

Reply via email to