summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--gio/gfile.override16
-rw-r--r--gio/gio.defs15
-rw-r--r--gio/gio.override20
4 files changed, 61 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a789c69..434e83d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-02-10 Gian Mario Tagliaretti <gianmt@gnome.org>
+ Bug 556250 – non-async functions don't release python locks before
+ calling blocking C functions
+
+ * gio/gio.override:
+ * gio/gfile.override:
+ * gio/gio.defs: release the thread lock.
+
+2009-02-10 Gian Mario Tagliaretti <gianmt@gnome.org>
+
* gio/gio.defs:
* gio/gio-types.defs:
* gio/unix.defs: Add 2.18 gio API.
@@ -165,6 +174,7 @@
* configure.ac: Branch, bump version to 2.17.0.
+=== 2.16.0 ===
2008-12-24 Paul Pogonyshev <pogonyshev@gmx.net>
Bug 547119 – gobject.timeout_add_seconds() not found in docs
diff --git a/gio/gfile.override b/gio/gfile.override
index 1dc566c..6c210ee 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -191,9 +191,13 @@ _wrap_g_file_load_contents(PyGObject *self,
if (!pygio_check_cancellable(pycancellable, &cancellable))
return NULL;
+ pyg_unblock_threads();
+
ret = g_file_load_contents(G_FILE(self->obj), cancellable,
&contents, &length, &etag_out, &error);
+ pyg_block_threads();
+
if (pyg_error_check(&error))
return NULL;
@@ -556,6 +560,8 @@ _wrap_g_file_copy(PyGObject *self,
/* No need to reference callback here, because it will be used
* only while this function is in progress. */
+ pyg_unblock_threads();
+
ret = g_file_copy(G_FILE(self->obj),
G_FILE(destination->obj),
flags,
@@ -564,6 +570,8 @@ _wrap_g_file_copy(PyGObject *self,
notify,
&error);
+ pyg_block_threads();
+
if (pyg_error_check(&error))
goto error;
@@ -698,6 +706,8 @@ _wrap_g_file_move(PyGObject *self,
/* No need to reference callback here, because it will be used
* only while this function is in progress. */
+ pyg_unblock_threads();
+
ret = g_file_move(G_FILE(self->obj),
G_FILE(destination->obj),
flags,
@@ -705,6 +715,8 @@ _wrap_g_file_move(PyGObject *self,
callback,
notify,
&error);
+
+ pyg_block_threads();
if (pyg_error_check(&error))
goto error;
@@ -1091,10 +1103,14 @@ _wrap_g_file_replace_contents(PyGObject *self, PyObject *args, PyObject *kwargs)
if (!pygio_check_cancellable(pycancellable, &cancellable))
return NULL;
+ pyg_unblock_threads();
+
ret = g_file_replace_contents(G_FILE(self->obj), contents, length, etag,
make_backup, flags, &new_etag, cancellable,
&error);
+ pyg_block_threads();
+
if (pyg_error_check(&error))
return NULL;
diff --git a/gio/gio.defs b/gio/gio.defs
index a13776e..718f947 100644
--- a/gio/gio.defs
+++ b/gio/gio.defs
@@ -364,6 +364,7 @@
(of-object "GBufferedInputStream")
(c-name "g_buffered_input_stream_fill")
(return-type "gssize")
+ (unblock-threads #t)
(parameters
'("gssize" "count")
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1486,6 +1487,7 @@
)
(c-name "g_file_read")
(return-type "GFileInputStream*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1533,6 +1535,7 @@
(of-object "GFile")
(c-name "g_file_append_to")
(return-type "GFileOutputStream*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("GFileCreateFlags" "flags" (default "G_FILE_CREATE_NONE"))
@@ -1545,6 +1548,7 @@
(of-object "GFile")
(c-name "g_file_create")
(return-type "GFileOutputStream*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("GFileCreateFlags" "flags" (default "G_FILE_CREATE_NONE"))
@@ -1557,6 +1561,7 @@
(of-object "GFile")
(c-name "g_file_replace")
(return-type "GFileOutputStream*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("const-char*" "etag")
@@ -1705,6 +1710,7 @@
(of-object "GFile")
(c-name "g_file_query_info")
(return-type "GFileInfo*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("const-char*" "attributes")
@@ -1758,6 +1764,7 @@
(of-object "GFile")
(c-name "g_file_query_filesystem_info")
(return-type "GFileInfo*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("const-char*" "attributes")
@@ -1770,6 +1777,7 @@
(of-object "GFile")
(c-name "g_file_find_enclosing_mount")
(return-type "GMount*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
@@ -1825,6 +1833,7 @@
(of-object "GFile")
(c-name "g_file_enumerate_children")
(return-type "GFileEnumerator*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("const-char*" "attributes")
@@ -1878,6 +1887,7 @@
(of-object "GFile")
(c-name "g_file_set_display_name")
(return-type "GFile*")
+ (unblock-threads #t)
(caller-owns-return #t)
(parameters
'("const-char*" "display_name")
@@ -1914,6 +1924,7 @@
(of-object "GFile")
(c-name "g_file_delete")
(return-type "gboolean")
+ (unblock-threads #t)
(parameters
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
'("GError**" "error")
@@ -1924,6 +1935,7 @@
(of-object "GFile")
(c-name "g_file_trash")
(return-type "gboolean")
+ (unblock-threads #t)
(parameters
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
'("GError**" "error")
@@ -2086,6 +2098,7 @@
(of-object "GFile")
(c-name "g_file_make_directory")
(return-type "gboolean")
+ (unblock-threads #t)
(parameters
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
'("GError**" "error")
@@ -2096,6 +2109,7 @@
(of-object "GFile")
(c-name "g_file_make_directory_with_parents")
(return-type "gboolean")
+ (unblock-threads #t)
(parameters
'("GCancellable*" "cancellable")
'("GError**" "error")
@@ -2106,6 +2120,7 @@
(of-object "GFile")
(c-name "g_file_make_symbolic_link")
(return-type "gboolean")
+ (unblock-threads #t)
(parameters
'("const-char*" "symlink_value")
'("GCancellable*" "cancellable" (null-ok) (default "NULL"))
diff --git a/gio/gio.override b/gio/gio.override
index 6337971..ceb2944 100644
--- a/gio/gio.override
+++ b/gio/gio.override
@@ -240,8 +240,12 @@ _wrap_g_drive_get_volumes (PyGObject *self)
GList *list, *l;
PyObject *ret;
+ pyg_unblock_threads();
+
list = g_drive_get_volumes (G_DRIVE (self->obj));
+ pyg_block_threads();
+
ret = PyList_New(0);
for (l = list; l; l = l->next) {
GVolume *volume = l->data;
@@ -330,10 +334,14 @@ _wrap_g_drive_poll_for_media(PyGObject *self, PyObject *args, PyObject *kwargs)
pygio_notify_reference_callback(notify);
+ pyg_unblock_threads();
+
g_drive_poll_for_media(G_DRIVE(self->obj),
cancellable,
(GAsyncReadyCallback) async_result_callback_marshal,
notify);
+
+ pyg_block_threads();
Py_INCREF(Py_None);
return Py_None;
@@ -482,12 +490,16 @@ _wrap_g_mount_unmount(PyGObject *self,
pygio_notify_reference_callback(notify);
+ pyg_unblock_threads();
+
g_mount_unmount(G_MOUNT(self->obj),
flags,
cancellable,
(GAsyncReadyCallback)async_result_callback_marshal,
notify);
+ pyg_block_threads();
+
Py_INCREF(Py_None);
return Py_None;
@@ -530,12 +542,16 @@ _wrap_g_mount_eject(PyGObject *self, PyObject *args, PyObject *kwargs)
pygio_notify_reference_callback(notify);
+ pyg_unblock_threads();
+
g_mount_eject(G_MOUNT(self->obj),
flags,
cancellable,
(GAsyncReadyCallback) async_result_callback_marshal,
notify);
+ pyg_block_threads();
+
Py_INCREF(Py_None);
return Py_None;
@@ -592,6 +608,8 @@ _wrap_g_mount_remount(PyGObject *self, PyObject *args, PyObject *kwargs)
pygio_notify_reference_callback(notify);
+ pyg_unblock_threads();
+
g_mount_remount(G_MOUNT(self->obj),
flags,
mount_operation,
@@ -599,6 +617,8 @@ _wrap_g_mount_remount(PyGObject *self, PyObject *args, PyObject *kwargs)
(GAsyncReadyCallback) async_result_callback_marshal,
notify);
+ pyg_block_threads();
+
Py_INCREF(Py_None);
return Py_None;