After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 395048 - set_property() doesn't release the GIL
set_property() doesn't release the GIL
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
Git master
Other Linux
: Normal major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-10 16:00 UTC by Edward Hervey
Modified: 2007-03-03 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (421 bytes, patch)
2007-01-10 16:03 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2007-01-10 16:00:13 UTC
Currently, when setting a property on an object, the GIL isn't released in set_property_from_pspec .

It should be released, since there's no guarantee that there will never be:
_ some code will be called in that code that will trigger a callback of some python code (and therefore needing the GIL)
_ some code in a different thread that needs to call some python code, before releasing a lock which is needed by the thread currently calling .set_property()

The GIL needs to be released in order for other python code to be called while set_property() is happening, and avoid deadlocks.
Comment 1 Edward Hervey 2007-01-10 16:03:01 UTC
Created attachment 79959 [details] [review]
Proposed patch
Comment 2 Johan (not receiving bugmail) Dahlin 2007-01-26 15:06:24 UTC
Comment on attachment 79959 [details] [review]
Proposed patch

This looks okay to me, feel free to commit it SVN trunk.
Comment 3 Edward Hervey 2007-03-03 13:31:20 UTC
2007-03-03  Edward Hervey  <edward@fluendo.com>

	* gobject/pygobject.c: (set_property_from_pspec):
	Release the GIL when calling g_object_set_property, since setting a
	property might trigger some code that might come back in python land.
	Fixes #395048