1
0
Fork 0

kms: Keep a shutting_down flag

Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2022-04-20 18:33:43 +08:00 committed by Mingi Sung
parent fc7ece8a13
commit c2da109fdc
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5
2 changed files with 11 additions and 0 deletions

View file

@ -63,6 +63,8 @@ struct _MetaKms
int kernel_thread_inhibit_count;
MetaKmsCursorManager *cursor_manager;
gboolean shutting_down;
};
G_DEFINE_TYPE (MetaKms, meta_kms, META_TYPE_THREAD)
@ -339,6 +341,12 @@ meta_kms_create_device (MetaKms *kms,
return device;
}
gboolean
meta_kms_is_shutting_down (MetaKms *kms)
{
return kms->shutting_down;
}
static gpointer
prepare_shutdown_in_impl (MetaThreadImpl *thread_impl,
gpointer user_data,
@ -354,6 +362,7 @@ static void
on_prepare_shutdown (MetaBackend *backend,
MetaKms *kms)
{
kms->shutting_down = TRUE;
meta_kms_run_impl_task_sync (kms, prepare_shutdown_in_impl, NULL, NULL);
meta_thread_flush_callbacks (META_THREAD (kms));

View file

@ -60,6 +60,8 @@ MetaKmsDevice * meta_kms_create_device (MetaKms *kms,
MetaKmsDeviceFlag flags,
GError **error);
gboolean meta_kms_is_shutting_down (MetaKms *kms);
MetaKms * meta_kms_new (MetaBackend *backend,
MetaKmsFlags flags,
GError **error);