diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 8977c67..9d82087 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3466,7 +3466,7 @@ g_dbus_connection_signal_subscribe (GDBusConnection     *connection,
   subscriber.callback = callback;
   subscriber.user_data = user_data;
   subscriber.user_data_free_func = user_data_free_func;
-  subscriber.id = _global_subscriber_id++; /* TODO: overflow etc. */
+  subscriber.id = g_atomic_int_add (&_global_subscriber_id, 1); /* TODO: overflow etc. */
   subscriber.context = g_main_context_ref_thread_default ();
 
   /* see if we've already have this rule */
