From f820e2540f905f865472984fb6806d328a180ce4 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 1 Jan 2003 00:18:54 +0000 Subject: [PATCH] applied upstream, remove patch Original commit message from CVS: applied upstream, remove patch --- common | 2 +- pygtk.diff | 131 ----------------------------------------------------- 2 files changed, 1 insertion(+), 132 deletions(-) delete mode 100644 pygtk.diff diff --git a/common b/common index 79e6940e7f..4a7bc52a89 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 79e6940e7ff1a6cbf959a1f7a0a3d1ed3f90d3ee +Subproject commit 4a7bc52a893bdd9fefa9fabe460c827822a9e0f2 diff --git a/pygtk.diff b/pygtk.diff deleted file mode 100644 index d0cf844a2f..0000000000 --- a/pygtk.diff +++ /dev/null @@ -1,131 +0,0 @@ -Index: gtk/gdk.override -=================================================================== -RCS file: /cvs/gnome/gnome-python/pygtk/gtk/gdk.override,v -retrieving revision 1.24 -diff -u -r1.24 gdk.override ---- gtk/gdk.override 24 Aug 2002 14:25:23 -0000 1.24 -+++ gtk/gdk.override 7 Nov 2002 07:26:25 -0000 -@@ -55,37 +55,96 @@ - * particularly appealing. - */ - #ifdef ENABLE_PYGTK_THREADING -+//#define LDBG -+#define LCNT -+//#define BMTX - static GStaticPrivate pythreadstate_key = G_STATIC_PRIVATE_INIT; --static GStaticPrivate counter_key = G_STATIC_PRIVATE_INIT; --#define INITIAL_LOCK_COUNT 1 -+static GStaticPrivate lock_count_key = G_STATIC_PRIVATE_INIT; -+static PyInterpreterState *pyinterpstate = NULL; -+#ifdef BMTX -+static GStaticMutex foo = G_STATIC_MUTEX_INIT; -+#endif - - static void - pygdk_block_threads (void) - { -- gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key)); -+ gint lock_count = GPOINTER_TO_INT(g_static_private_get(&lock_count_key)); -+#ifdef BMTX -+ g_static_mutex_lock(&foo); -+#endif - -- if (counter == INITIAL_LOCK_COUNT) { -- PyThreadState *_save; -+#ifdef LDBG -+ fprintf(stderr, "->b (%p) c %d\n", g_thread_self(), lock_count); -+#endif -+#ifdef LCNT -+ if (lock_count == 0) { -+#else -+ { -+#endif -+ PyThreadState *_save; - - _save = g_static_private_get(&pythreadstate_key); -+#ifdef LDBG -+ fprintf(stderr, "->b ->t (%p) (ts:%p) c %d\n", g_thread_self(), _save, lock_count); -+#endif -+ if (_save == NULL) { -+#ifdef LDBG -+ fprintf(stderr, "->b ->t _save == NULL (%p) c %d\n", g_thread_self(), lock_count); -+#endif -+ _save = PyThreadState_New(pyinterpstate); -+#ifdef LDBG -+ fprintf(stderr, "->b ->t (%p) (new ts:%p) c %d\n", g_thread_self(), _save, lock_count); -+#endif -+ } - Py_BLOCK_THREADS; -+#ifdef LDBG -+ fprintf(stderr, "->b <-t (%p) c %d\n", g_thread_self(), lock_count); -+#endif - } -- counter--; -- g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL); -+ lock_count++; -+ g_static_private_set(&lock_count_key, GINT_TO_POINTER(lock_count), NULL); -+#ifdef LDBG -+ fprintf(stderr, "<-b (%p) c %d\n", g_thread_self(), lock_count); -+#endif -+#ifdef BMTX -+ g_static_mutex_unlock(&foo); -+#endif - } - static void - pygdk_unblock_threads (void) - { -- gint counter = GPOINTER_TO_INT(g_static_private_get(&counter_key)); -+ gint lock_count = GPOINTER_TO_INT(g_static_private_get(&lock_count_key)); -+#ifdef BMTX -+ g_static_mutex_lock(&foo); -+#endif - -- counter++; -- if (counter == INITIAL_LOCK_COUNT) { -- PyThreadState *_save; -+#ifdef LDBG -+ fprintf(stderr, "->u (%p) c %d\n", g_thread_self(), lock_count); -+#endif -+ lock_count--; -+#ifdef LCNT -+ if (lock_count == 0) { -+#else -+ { -+#endif -+ PyThreadState *_save; - -+#ifdef LDBG -+ fprintf(stderr, "->u ->t (%p) (ts:%p) c %d\n", g_thread_self(), g_static_private_get(&pythreadstate_key), lock_count); -+#endif - Py_UNBLOCK_THREADS; -+#ifdef LDBG -+ fprintf(stderr, "->u <-t (%p) (s:%p) (ts:%p) c %d\n", g_thread_self(), _save, g_static_private_get(&pythreadstate_key), lock_count); -+#endif - g_static_private_set(&pythreadstate_key, _save, NULL); - } -- g_static_private_set(&counter_key, GINT_TO_POINTER(counter), NULL); -+ g_static_private_set(&lock_count_key, GINT_TO_POINTER(lock_count), NULL); -+#ifdef LDBG -+ fprintf(stderr, "<-u (%p) c %d\n", g_thread_self(), lock_count); -+#endif -+#ifdef BMTX -+ g_static_mutex_unlock(&foo); -+#endif - } - #endif - -@@ -96,7 +155,14 @@ - /* register gdk thread block/unblock routines with gobjectmodule */ - pyg_set_thread_block_funcs (pygdk_block_threads, pygdk_unblock_threads); - -+ PyEval_InitThreads(); - gdk_threads_init(); -+ g_static_private_set(&lock_count_key, GINT_TO_POINTER(1), NULL); -+ -+#ifdef LDBG -+ fprintf(stderr, "%s:%s:%d thread state (%p)\n", __FILE__,__FUNCTION__,__LINE__, PyThreadState_Get()); -+#endif -+ pyinterpstate = PyThreadState_Get()->interp; - - Py_INCREF(Py_None); - return Py_None;