From 6ef1896d507b431fec307a86d42de820b563db33 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Wed, 10 Apr 2024 16:55:29 +0300 Subject: [PATCH] test --- dialogs.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dialogs.c b/dialogs.c index 527c47af..beabeb01 100644 --- a/dialogs.c +++ b/dialogs.c @@ -450,6 +450,7 @@ static void refresh_usb(void) bool scan = false; gchar *active_uri = NULL; + gdk_threads_enter(); widget_set_cursor(dialogs.connect, GDK_WATCH); if (gtk_combo_box_get_active(GTK_COMBO_BOX(dialogs.connect_usbd)) != -1) { @@ -498,19 +499,20 @@ static void refresh_usb(void) if (!ctxs) goto nope; -#ifdef __APPLE__ - // Scanning seems to be broken at the moment - goto nope; -#endif - - + printf("filter%s\n", filter); +// pthread_mutex_t lock; +// printf("pthread_mutex_init%s\n", filter); +// pthread_mutex_init(&lock, NULL); +// printf("pthread_mutex_initialized%s\n", filter); ret = iio_scan_context_get_info_list(ctxs, &info); + printf("ret nb ctxs: %d\n", (int)ret); if (ret < 0) goto err_free_ctxs; if (!ret) goto err_free_info_list; for (i = 0; i < (size_t) ret; i++) { + printf("info ctx %s\n", iio_context_info_get_description(info[i])); tmp = strdup(iio_context_info_get_description(info[i])); pid = strdup(iio_context_info_get_description(info[i])); @@ -559,11 +561,14 @@ static void refresh_usb(void) free(buf); free(tmp); } + gdk_threads_leave(); err_free_info_list: iio_context_info_list_free(info); + gdk_threads_leave(); err_free_ctxs: iio_scan_context_destroy(ctxs); + gdk_threads_leave(); nope: widget_use_parent_cursor(dialogs.connect); @@ -594,6 +599,8 @@ static void refresh_usb(void) /* Fill things in */ connect_clear(dialogs.connect_usb); + gdk_threads_leave(); + } #ifdef SERIAL_BACKEND