Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandraTrifan committed Apr 11, 2024
1 parent d81df1f commit 4cc018c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ endif()
# which doesn't seem to exist; but we only need -lmatio, so force it here
set(MATIO_LIBRARIES -lmatio)

find_library(PTHREAD_LIBRARIES pthread)
message("PTHREAD " ${PTHREAD_LIBRARIES})
set(LIBOSC_LIBS
${GLIB_LIBRARIES}
${GLIBCONFIG_LIBRARIES}
Expand All @@ -168,6 +170,7 @@ set(LIBOSC_LIBS
${LIBAD9361_LIBRARIES}
${LIBAD9166_LIBRARIES}
dl
${PTHREAD_LIBRARIES}
)

configure_file(config.h.cmakein ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY)
Expand Down Expand Up @@ -246,6 +249,7 @@ target_link_libraries(oscmain PRIVATE
${GTK_LIBRARIES}
${LIBIIO_LIBRARIES}
osc
${PTHREAD_LIBRARIES}
)
set_target_properties(oscmain PROPERTIES OUTPUT_NAME osc)

Expand Down
13 changes: 7 additions & 6 deletions dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,19 +498,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%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]));

Expand Down
1 change: 1 addition & 0 deletions osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ int plugin_data_capture_of_plot(OscPlot *plot, const char *device, gfloat ***coo
osc_plot_set_markers_copy(plot, *markers_cp);

/* Wait til the copy is complete */
printf("g_mutex_lock\n");
g_mutex_lock(markers_lock);

/* if the lock is released, but the copy is still here
Expand Down
5 changes: 5 additions & 0 deletions oscplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,7 @@ static void do_fft(Transform *tr)
sizeof(struct marker_type) * MAX_MARKERS);
*settings->markers_copy = NULL;
g_mutex_unlock(settings->marker_lock);
printf("g_mutex_unlock");
}
}
}
Expand Down Expand Up @@ -1679,6 +1680,7 @@ bool cross_correlation_transform_function(Transform *tr, gboolean init_transform
sizeof(struct marker_type) * MAX_MARKERS);
*settings->markers_copy = NULL;
g_mutex_unlock(settings->marker_lock);
printf("g_mutex_unlock");
}
}

Expand Down Expand Up @@ -1758,6 +1760,7 @@ bool freq_spectrum_transform_function(Transform *tr, gboolean init_transform)
sizeof(struct marker_type) * MAX_MARKERS);
*settings->markers_copy = NULL;
g_mutex_unlock(settings->marker_lock);
printf("g_mutex_unlock");
}
}

Expand Down Expand Up @@ -3523,6 +3526,7 @@ static void capture_button_clicked_cb(GtkToggleToolButton *btn, gpointer data)

g_mutex_trylock(&priv->g_marker_copy_lock);
g_mutex_unlock(&priv->g_marker_copy_lock);
printf("g_mutex_trylock g_mutex_unlock");

g_signal_emit(plot, oscplot_signals[CAPTURE_EVENT_SIGNAL], 0, button_state);
}
Expand Down Expand Up @@ -4410,6 +4414,7 @@ static void plot_destroyed (GtkWidget *object, OscPlot *plot)
g_slist_free_full(plot->priv->ch_settings_list, (GDestroyNotify)g_free);
g_mutex_trylock(&plot->priv->g_marker_copy_lock);
g_mutex_unlock(&plot->priv->g_marker_copy_lock);
printf("g_mutex_trylock g_mutex_unlock");

g_signal_emit(plot, oscplot_signals[DESTROY_EVENT_SIGNAL], 0);
}
Expand Down

0 comments on commit 4cc018c

Please sign in to comment.