kms: Keep a shutting_down flag
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
This commit is contained in:
parent
276c4fa6c5
commit
f7b296f2a9
@ -66,6 +66,8 @@ struct _MetaKms
|
||||
int kernel_thread_inhibit_count;
|
||||
|
||||
MetaKmsCursorManager *cursor_manager;
|
||||
|
||||
gboolean shutting_down;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaKms, meta_kms, META_TYPE_THREAD)
|
||||
@ -352,6 +354,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,
|
||||
@ -367,6 +375,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));
|
||||
|
||||
|
@ -61,6 +61,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…
x
Reference in New Issue
Block a user