GNOME Bugzilla – Bug 632544
g_dbus_connection_send_message can not send a locked message with G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag
Last modified: 2010-12-13 18:14:02 UTC
Created attachment 172704 [details] [review] Test case for g_dbus_connection_send_message As description of API document. g_dbus_connection_send_message should support sending locked message with G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. But it cannot. The document is here: http://library.gnome.org/devel/gio/stable/GDBusConnection.html#g-dbus-connection-send-message Note that message must be unlocked, unless flags contain the G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. Test case is in the attached patch
Review of attachment 172704 [details] [review]: ::: gio/tests/gdbus-connection.c @@ +889,3 @@ + + while (data.num_handled == 2) + This looks like it's missing the g_thread_yield(). But (to davidz) as we discussed on IRC this is broken since there's no memory barrier. You could lock/unlock a mutex around this check, or better use a condition variable.
Created attachment 172784 [details] [review] Update the test case Add g_thread_yield ().
Created attachment 172785 [details] [review] Patch for fixing this problem
ping
Anyone can help to check this bug?
Sorry for the delay. Committed on master and glib-2-26. Thanks! http://git.gnome.org/browse/glib/commit/?id=735fcf918e70035874b50785524d25eda557d51f http://git.gnome.org/browse/glib/commit/?h=glib-2-26&id=62476cd0f7ca7d3becf81243fb7ac1b97cf7db51