GDBusConnection: replace is_initialized with an atomic flag
GDBusConnection: replace is_initialized with an atomic flag

The comment implied that even failed initialization would set
is_initialized = TRUE, but this wasn't the case - failed initialization
would only set initialization_error, and it was necessary to check both.

It turns out the documented semantics are nicer than the implemented
semantics, since this lets us use atomic operations, which are also
memory barriers, to avoid needing separate memory barriers or locks
for initialization_error (and other members that are read-only after
construction).

I expect to need more than one atomically-accessed flag to fix thread
safety, so instead of a minimal implementation I've turned is_initialized
into a flags word.

Signed-off-by: Simon McVittie <2b470b34502dbf3ba4bcc04ea7e64f4e0e104f33@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661689
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661992
Reviewed-by: David Zeuthen <16a4bae6a7afea1fdd75baca6404fe68f285db96@redhat.com>

Distrotech/glib,cention-sany/glib,tamaskenez/glib,johne53/MB3Glib,endlessm/glib,johne53/MB3Glib,bluez-android/glib,darren-clark/android_platform_external_bluetooth_glib,Distrotech/glib,cention-sany/glib,01org/android-bluez-glib,lukasz-skalski/glib,djdeath/glib,justinkb/aosp-bluez.glib,mzabaluev/glib,tamaskenez/glib,justinkb/aosp-bluez.glib,darren-clark/android_platform_external_bluetooth_glib,pstglia/platform-external-bluetooth-glib,endlessm/glib,ieei/glib,krichter722/glib,darren-clark/android_platform_external_bluetooth_glib,pstglia/platform-external-bluetooth-glib,djdeath/glib,mzabaluev/glib,darren-clark/android_platform_external_bluetooth_glib,bluez-android/glib,krichter722/glib,01org/android-bluez-glib,tamaskenez/glib,tchakabam/glib,cention-sany/glib,tamaskenez/glib,endlessm/glib,iConsole/Console-OS_external_bluetooth_glib,antono/glib,pstglia/external-bluetooth-glib,pstglia/platform-external-bluetooth-glib,gale320/glib,ieei/glib,cention-sany/glib,Distrotech/glib,djdeath/glib,johne53/MB3Glib,krichter722/glib,lukasz-skalski/glib,pstglia/external-bluetooth-glib,tchakabam/glib,mzabaluev/glib,iConsole/Console-OS_external_bluetooth_glib,pstglia/platform-external-bluetooth-glib,pstglia/external-bluetooth-glib,bluez-android/glib,pstglia/external-bluetooth-glib,lukasz-skalski/glib,iConsole/Console-OS_external_bluetooth_glib,iConsole/Console-OS_external_bluetooth_glib,endlessm/glib,cosimoc/glib,lukasz-skalski/glib,01org/android-bluez-glib,tchakabam/glib,MathieuDuponchelle/glib,antono/glib,tchakabam/glib,johne53/MB3Glib,krichter722/glib,01org/android-bluez-glib,cosimoc/glib,Distrotech/glib,01org/android-bluez-glib,cosimoc/glib,ieei/glib,darren-clark/android_platform_external_bluetooth_glib,MathieuDuponchelle/glib,gale320/glib,pstglia/platform-external-bluetooth-glib,gale320/glib,pstglia/external-bluetooth-glib,cosimoc/glib,justinkb/aosp-bluez.glib,djdeath/glib,lukasz-skalski/glib,cosimoc/glib,MathieuDuponchelle/glib,tchakabam/glib,antono/glib,MathieuDuponchelle/glib,justinkb/aosp-bluez.glib,bluez-android/glib,antono/glib,endlessm/glib,gale320/glib,MathieuDuponchelle/glib,djdeath/glib,iConsole/Console-OS_external_bluetooth_glib,bluez-android/glib,krichter722/glib,mzabaluev/glib,justinkb/aosp-bluez.glib,ieei/glib,ieei/glib,johne53/MB3Glib,johne53/MB3Glib,tamaskenez/glib,Distrotech/glib,mzabaluev/glib,gale320/glib,cention-sany/glib