summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2018-02-08 10:41:01 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2018-02-08 10:41:01 +0100
commit6b414014de24dd9671e491c765c7c5535cd05d40 (patch)
tree6653b3f2f89603678fa7fabbdcdbbd55c7427c39 /bin
parent2a383d2e9d13f5e652cb4e00ccb61558303d6f84 (diff)
downloaduca-6b414014de24dd9671e491c765c7c5535cd05d40.tar.gz
uca-6b414014de24dd9671e491c765c7c5535cd05d40.tar.bz2
uca-6b414014de24dd9671e491c765c7c5535cd05d40.tar.xz
uca-6b414014de24dd9671e491c765c7c5535cd05d40.zip
Raise minimum GLib version to 2.38
Diffstat (limited to 'bin')
-rw-r--r--bin/gui/uca-camera-control.c22
-rw-r--r--bin/tools/benchmark.c10
2 files changed, 10 insertions, 22 deletions
diff --git a/bin/gui/uca-camera-control.c b/bin/gui/uca-camera-control.c
index 375de2f..94f3bb8 100644
--- a/bin/gui/uca-camera-control.c
+++ b/bin/gui/uca-camera-control.c
@@ -1053,11 +1053,8 @@ on_start_button_clicked (GtkWidget *widget, ThreadData *data)
data->state = RUNNING;
set_tool_button_state (data);
- if (!g_thread_create (preview_frames, data, FALSE, &error)) {
- g_printerr ("Failed to create thread: %s\n", error->message);
- data->state = IDLE;
- set_tool_button_state (data);
- }
+ /* FIXME: clean up struct */
+ g_thread_new (NULL, preview_frames, data);
}
static void
@@ -1094,11 +1091,8 @@ on_record_button_clicked (GtkWidget *widget, ThreadData *data)
data->state = RECORDING;
set_tool_button_state (data);
- if (!g_thread_create (record_frames, data, FALSE, &error)) {
- g_printerr ("Failed to create thread: %s\n", error->message);
- data->state = IDLE;
- set_tool_button_state (data);
- }
+ /* FIXME: clean up struct */
+ g_thread_new (NULL, record_frames, data);
}
static gpointer
@@ -1160,11 +1154,8 @@ download_frames (ThreadData *data)
static void
on_download_button_clicked (GtkWidget *widget, ThreadData *data)
{
- GError *error = NULL;
-
- if (!g_thread_create ((GThreadFunc) download_frames, data, FALSE, &error)) {
- g_printerr ("Failed to create thread: %s\n", error->message);
- }
+ /* FIXME: clean up thread struct somewhere */
+ g_thread_new (NULL, (GThreadFunc) download_frames, data);
gtk_widget_set_sensitive (data->main_window, FALSE);
gtk_window_set_modal (GTK_WINDOW (data->download_dialog), TRUE);
@@ -1595,7 +1586,6 @@ main (int argc, char *argv[])
return 1;
}
- g_thread_init (NULL);
gdk_threads_init ();
gtk_init (&argc, &argv);
diff --git a/bin/tools/benchmark.c b/bin/tools/benchmark.c
index 99050f7..f6d7d7d 100644
--- a/bin/tools/benchmark.c
+++ b/bin/tools/benchmark.c
@@ -153,19 +153,19 @@ grab_frames_readout (UcaCamera *camera, gpointer buffer, guint n_frames, UcaCame
static void
grab_callback (gpointer data, gpointer user_data)
{
- static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
+ static GMutex mutex;
guint *n_acquired_frames = user_data;
- g_static_mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
*n_acquired_frames += 1;
- g_static_mutex_unlock (&mutex);
+ g_mutex_unlock (&mutex);
}
static guint
grab_frames_async (UcaCamera *camera, gpointer buffer, guint n_frames, UcaCameraTriggerSource trigger_source, GTimer *timer)
{
GError *error = NULL;
- volatile guint n_acquired_frames = 0;
+ guint n_acquired_frames = 0;
g_object_set (camera, "trigger-source", trigger_source, NULL);
uca_camera_set_grab_func (camera, grab_callback, &n_acquired_frames);
@@ -363,8 +363,6 @@ main (int argc, char *argv[])
g_io_channel_shutdown (log_channel, TRUE, &error);
g_assert_no_error (error);
-
-cleanup_camera:
g_object_unref (camera);
cleanup_manager: