return 0;
}
+static void
+wsi_display_stop_wait_thread(struct wsi_display *wsi)
+{
+ pthread_mutex_lock(&wsi->wait_mutex);
+ if (wsi->wait_thread) {
+ pthread_cancel(wsi->wait_thread);
+ pthread_join(wsi->wait_thread, NULL);
+ wsi->wait_thread = 0;
+ }
+ pthread_mutex_unlock(&wsi->wait_mutex);
+}
+
/*
* Wait for at least one event from the kernel to be processed.
* Call with wait_mutex held
vk_free(wsi->alloc, connector);
}
- pthread_mutex_lock(&wsi->wait_mutex);
- if (wsi->wait_thread) {
- pthread_cancel(wsi->wait_thread);
- pthread_join(wsi->wait_thread, NULL);
- }
- pthread_mutex_unlock(&wsi->wait_mutex);
+ wsi_display_stop_wait_thread(wsi);
pthread_mutex_destroy(&wsi->wait_mutex);
pthread_cond_destroy(&wsi->wait_cond);
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
if (wsi->fd >= 0) {
+ wsi_display_stop_wait_thread(wsi);
+
close(wsi->fd);
wsi->fd = -1;
}
+
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
wsi_display_connector_from_handle(display)->output = None;
#endif