[python?] DBus + gtk + thread = problems

René 'Necoro' Neumann lists at necoro.eu
Wed Mar 19 06:18:02 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Simon McVittie schrieb:
| On Wed, 19 Mar 2008 at 13:08:57 +0100, René 'Necoro' Neumann wrote:
|> I yesterday discovered a bug in dbus (or dbus-python) when using dbus
|> inside of a (py)gtk application: As an example, I create a window with a
|> button. When clicking the button, a new thread is started which runs a
|> dbus statement. (see attached example)
|
| You need to tell dbus-glib to initialize libdbus' thread locks, which
| you can do via:
|
| from dbus.mainloop.glib import threads_init
| threads_init()
|
| Otherwise, libdbus will have no thread locking, and will concurrently
| modify data in multiple threads. Don't let it do that.
|
|     Simon

Hey - this is not fair =| ... I spent several hours with nailing down
the problem and creating proper backtraces - and then the solution is so
easy :)

Thanks - works ;)

- - Necoro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4RKK4UOg/zhYFuARAq9jAJ9AnpFJJttLWNZYaO+973/sWnxQvgCbBJ8k
CRFg5ZxwPbYP3oRTD/PMKo0=
=5aoX
-----END PGP SIGNATURE-----


More information about the dbus mailing list