summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2023-02-20 14:57:57 -0500
committerMichael Catanzaro <mcatanzaro@redhat.com>2023-02-23 14:48:48 -0600
commit5c0321904fa9a2d5b4096a4ade57ec7e97136cf8 (patch)
treeac343b0bd8acea4253430167e7bc8ad6389cc6e1
parente5c0be404c48d09f5a637e1737da01d391e10154 (diff)
downloadgnome-online-accounts-5c0321904fa9a2d5b4096a4ade57ec7e97136cf8.tar.gz
goakerberosidentitymanager: Ensure identity-expired signal is emitted from main loop thread
Right now most of the the identity manager signals get emitted from the main thread. This makes sense, and is what a caller would typically expect (given they connect their callbacks in the main thread as well). The one exception is "identity-expired" which gets emitted from the worker thread. This commit fixes that.
-rw-r--r--src/goaidentity/goakerberosidentitymanager.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/goaidentity/goakerberosidentitymanager.c b/src/goaidentity/goakerberosidentitymanager.c
index c4c5aba..7ddbf3a 100644
--- a/src/goaidentity/goakerberosidentitymanager.c
+++ b/src/goaidentity/goakerberosidentitymanager.c
@@ -282,11 +282,28 @@ identity_signal_work_free (IdentitySignalWork *work)
}
static void
+do_identity_signal_expired_work (IdentitySignalWork *work)
+{
+ GoaKerberosIdentityManager *self = work->manager;
+ GoaIdentity *identity = work->identity;
+
+ g_debug ("GoaKerberosIdentityManager: identity expired");
+ _goa_identity_manager_emit_identity_expired (GOA_IDENTITY_MANAGER (self), identity);
+}
+
+static void
on_identity_expired (GoaIdentity *identity,
GoaKerberosIdentityManager *self)
{
- _goa_identity_manager_emit_identity_expired (GOA_IDENTITY_MANAGER (self),
- identity);
+ IdentitySignalWork *work;
+
+ work = identity_signal_work_new (self, identity);
+ goa_kerberos_identify_manager_send_to_context (g_main_context_default (),
+ (GSourceFunc)
+ do_identity_signal_expired_work,
+ work,
+ (GDestroyNotify)
+ identity_signal_work_free);
}
static void