GNOME Bugzilla – Bug 700855
[PATCH] gdbus-peer: Drop some usage of g_thread_yield()
Last modified: 2013-05-23 14:12:06 UTC
It's a recipe for race conditions and error; on some hardware architectures one thread isn't guaranteed to see the results of writes from another thread without a cache flush. --- gio/tests/gdbus-peer.c | 66 +++++++++++++++++++++++++++++++---------------- 1 files changed, 43 insertions(+), 23 deletions(-)
Created attachment 245079 [details] [review] 0001-gdbus-peer-Drop-some-usage-of-g_thread_yield.patch
Comment on attachment 245079 [details] [review] 0001-gdbus-peer-Drop-some-usage-of-g_thread_yield.patch Patch looks good. This pattern shows up a lot (or, as in this case, fails to show up where it should have). It would be neat have something like: GThread *g_thread_new_wait (const gchar *, GThreadFunc, gpointer); void g_thread_signal_ready (void); Where g_thread_new_wait() calls g_thread_new() and then blocks until the new thread calls g_thread_signal_ready().
https://git.gnome.org/browse/glib/commit/?id=49030c8797d5a415e2cb94a3c658f67206cb8bf5