pygobject r1005 - in trunk: . gio



Author: gjc
Date: Tue Feb 17 10:59:49 2009
New Revision: 1005
URL: http://svn.gnome.org/viewvc/pygobject?rev=1005&view=rev

Log:
	* gio/gfile.override, gio/gio.defs, gio/gio.override: Bug 556250
	again.  I screwed up and gave misinformation about how to fix it.
	It must be pyg_begin/end_allow_threads, pyg_block/unblock_threads
	is only to be used for async callbacks.



Modified:
   trunk/ChangeLog
   trunk/gio/gfile.override
   trunk/gio/gio.defs
   trunk/gio/gio.override

Modified: trunk/gio/gfile.override
==============================================================================
--- trunk/gio/gfile.override	(original)
+++ trunk/gio/gfile.override	Tue Feb 17 10:59:49 2009
@@ -191,12 +191,12 @@
     if (!pygio_check_cancellable(pycancellable, &cancellable))
 	return NULL;
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     ret = g_file_load_contents(G_FILE(self->obj), cancellable,
                                &contents, &length, &etag_out, &error);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     if (pyg_error_check(&error))
         return NULL;
@@ -560,7 +560,7 @@
     /* No need to reference callback here, because it will be used
      * only while this function is in progress. */
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     ret = g_file_copy(G_FILE(self->obj),
 		      G_FILE(destination->obj),
@@ -570,7 +570,7 @@
 		      notify,
 		      &error);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     if (pyg_error_check(&error))
         goto error;
@@ -706,7 +706,7 @@
     /* No need to reference callback here, because it will be used
      * only while this function is in progress. */
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     ret = g_file_move(G_FILE(self->obj),
 		      G_FILE(destination->obj),
@@ -716,7 +716,7 @@
 		      notify,
 		      &error);
     
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     if (pyg_error_check(&error))
         goto error;
@@ -1103,13 +1103,13 @@
     if (!pygio_check_cancellable(pycancellable, &cancellable))
         return NULL;
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     ret = g_file_replace_contents(G_FILE(self->obj), contents, length, etag,
                                   make_backup, flags, &new_etag, cancellable,
                                   &error);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     if (pyg_error_check(&error))
         return NULL;

Modified: trunk/gio/gio.defs
==============================================================================
--- trunk/gio/gio.defs	(original)
+++ trunk/gio/gio.defs	Tue Feb 17 10:59:49 2009
@@ -1987,6 +1987,7 @@
 "(not the on-disk file), see gio.File.dup().")
   (of-object "GFile")
   (c-name "g_file_copy")
+  (unblock-threads #t)
   (return-type "gboolean")
   (parameters
     '("GFile*" "destination")

Modified: trunk/gio/gio.override
==============================================================================
--- trunk/gio/gio.override	(original)
+++ trunk/gio/gio.override	Tue Feb 17 10:59:49 2009
@@ -240,11 +240,11 @@
   GList *list, *l;
   PyObject *ret;
 
-  pyg_unblock_threads();
+  pyg_begin_allow_threads;
 
   list = g_drive_get_volumes (G_DRIVE (self->obj));
 
-  pyg_block_threads();
+  pyg_end_allow_threads;
 
   ret = PyList_New(0);
   for (l = list; l; l = l->next) {
@@ -334,14 +334,14 @@
 
     pygio_notify_reference_callback(notify);
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     g_drive_poll_for_media(G_DRIVE(self->obj),
 			   cancellable,
 			   (GAsyncReadyCallback) async_result_callback_marshal,
 			   notify);
     
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -490,7 +490,7 @@
 
     pygio_notify_reference_callback(notify);
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     g_mount_unmount(G_MOUNT(self->obj),
 		    flags,
@@ -498,7 +498,7 @@
 		    (GAsyncReadyCallback)async_result_callback_marshal,
 		    notify);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -542,7 +542,7 @@
 
     pygio_notify_reference_callback(notify);
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     g_mount_eject(G_MOUNT(self->obj),
 		  flags,
@@ -550,7 +550,7 @@
 		  (GAsyncReadyCallback) async_result_callback_marshal,
 		  notify);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -608,7 +608,7 @@
 
     pygio_notify_reference_callback(notify);
 
-    pyg_unblock_threads();
+    pyg_begin_allow_threads;
 
     g_mount_remount(G_MOUNT(self->obj),
 		    flags,
@@ -617,7 +617,7 @@
 		    (GAsyncReadyCallback) async_result_callback_marshal,
 		    notify);
 
-    pyg_block_threads();
+    pyg_end_allow_threads;
 
     Py_INCREF(Py_None);
     return Py_None;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]