[Galago-commits] r2918 - in trunk/notify-python: . src

galago-commits at freedesktop.org galago-commits at freedesktop.org
Sun Oct 8 11:02:57 PDT 2006


Author: chipx86
Date: 2006-10-08 11:02:52 -0700 (Sun, 08 Oct 2006)
New Revision: 2918

Modified:
   trunk/notify-python/ChangeLog
   trunk/notify-python/NEWS
   trunk/notify-python/src/pynotify.override
Log:
Patch by Johan Svedberg to fix some problems in thread-based programs.


Modified: trunk/notify-python/ChangeLog
===================================================================
--- trunk/notify-python/ChangeLog	2006-10-08 17:48:19 UTC (rev 2917)
+++ trunk/notify-python/ChangeLog	2006-10-08 18:02:52 UTC (rev 2918)
@@ -1,3 +1,9 @@
+Sun Oct 08 13:59:40 EDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/pynotify.override:
+	* NEWS:
+	  - Patch by Johan Svedberg to fix some problems in thread-based programs.
+
 Tue Sep 05 00:01:04 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* src/pynotify.defs:

Modified: trunk/notify-python/NEWS
===================================================================
--- trunk/notify-python/NEWS	2006-10-08 17:48:19 UTC (rev 2917)
+++ trunk/notify-python/NEWS	2006-10-08 18:02:52 UTC (rev 2918)
@@ -1,5 +1,7 @@
-version 0.1.1:
+version 0.1.1 (8-October-2006):
 	* Added Notification.attach_to_status_icon.
+	* Fixed problems when used in a program with threads. Patch by
+	  Johan Svedberg.
 
 version 0.1.0 (26-April-2006):
 	* Initial public release.

Modified: trunk/notify-python/src/pynotify.override
===================================================================
--- trunk/notify-python/src/pynotify.override	2006-10-08 17:48:19 UTC (rev 2917)
+++ trunk/notify-python/src/pynotify.override	2006-10-08 18:02:52 UTC (rev 2918)
@@ -105,8 +105,11 @@
 _notify_action_cb(NotifyNotification *n, const char *action,
 				  ActionCbData *data)
 {
+	PyGILState_STATE state;
 	PyObject *args;
 
+	state = pyg_gil_state_ensure();
+
 	if (data->user_data == Py_None)
 	{
 		args = Py_BuildValue("Os", data->notification, action);
@@ -119,6 +122,7 @@
 
 	PyEval_CallObject(data->callback, args);
 	Py_DECREF(args);
+	pyg_gil_state_release(state);
 }
 
 static void
@@ -146,11 +150,14 @@
     static char *kwlist[] = { "action", "label", "callback",
 	                          "user_data", NULL };
 	ActionCbData *action_cb_data;
+	PyGILState_STATE state;
 	PyObject *callback, *user_data = Py_None;
 	char *action;
 	char *label;
 	size_t len;
 
+	state = pyg_gil_state_ensure();
+
 	len = PyTuple_Size(args);
 
 	if (len < 3)
@@ -189,6 +196,7 @@
 								   (GFreeFunc)_action_cb_data_destroy);
 
 	Py_INCREF(Py_None);
+	pyg_gil_state_release(state);
 	return Py_None;
 }
 %%



More information about the galago-commits mailing list