The attached patch is currently applied by FreeBSD's ports. I don't know too much glib or pthread internals, but seems to be safe for Linux, I'm using it compiled with this patch right now and nothing crashed under me. If someone is able to see what this changes and can ask upstream what to do with this it would be really really good. Thanks, Diego
Created attachment 65853 [details, diff] glib-2.6.5-fbsd.patch
Considering this fixed for 2.8... I hope