kms: Keep a shutting_down flag
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
parent
fc7ece8a13
commit
c2da109fdc
2 changed files with 11 additions and 0 deletions
|
@ -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));
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue