From 59ba952661dc8e96656fa51183bfec3e8360f419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 21 Dec 2022 17:59:52 +0100 Subject: [PATCH] thread: Always add impl thread context as callback source This is helpful when we add callbacks that should be dispatched in the KMS impl thread. This invalidates an assumption about callbacks not being in the impl context, so some asserts for that are also removed. Part-of: --- src/backends/native/meta-thread-impl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/native/meta-thread-impl.c b/src/backends/native/meta-thread-impl.c index cae291393..123859146 100644 --- a/src/backends/native/meta-thread-impl.c +++ b/src/backends/native/meta-thread-impl.c @@ -215,6 +215,7 @@ meta_thread_impl_constructed (GObject *object) priv->impl_source = create_impl_source (thread_impl); priv->task_queue = g_async_queue_new (); + meta_thread_register_callback_context (priv->thread, priv->thread_context); G_OBJECT_CLASS (meta_thread_impl_parent_class)->constructed (object); } @@ -229,6 +230,8 @@ meta_thread_impl_finalize (GObject *object) g_clear_pointer (&priv->loop, g_main_loop_unref); g_clear_pointer (&priv->impl_source, g_source_destroy); g_clear_pointer (&priv->task_queue, g_async_queue_unref); + + meta_thread_unregister_callback_context (priv->thread, priv->thread_context); g_clear_pointer (&priv->thread_context, g_main_context_unref); G_OBJECT_CLASS (meta_thread_impl_parent_class)->finalize (object);