MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / main

Function main

3rdparty/asyncplusplus/examples/gtk_scheduler.cpp:78–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78int main(int argc, char *argv[])
79{
80 // Initialize GTK
81 gtk_init(&argc, &argv);
82
83 // Set wait handler on GTK thread to disallow waiting for tasks
84 async::set_thread_wait_handler(gtk_wait_handler);
85
86 // Create a window with a label
87 GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
88 g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
89 GtkLabel *label = GTK_LABEL(gtk_label_new("-"));
90 gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(label));
91 gtk_widget_show_all(window);
92
93 // Start a secondary thread to update the label
94 std::thread(label_update_thread, label).detach();
95
96 // Go to GTK main loop
97 gtk_main();
98}

Callers

nothing calls this directly

Calls 1

set_thread_wait_handlerFunction · 0.85

Tested by

no test coverage detected