Commit 2e83af7c authored by Max Kellermann's avatar Max Kellermann

io_thread: _timeout_add_seconds() returns GSource*

The numeric ID isn't so useful.
parent a3f7947a
...@@ -123,15 +123,14 @@ io_thread_idle_add(GSourceFunc function, gpointer data) ...@@ -123,15 +123,14 @@ io_thread_idle_add(GSourceFunc function, gpointer data)
return id; return id;
} }
guint GSource *
io_thread_timeout_add_seconds(guint interval, io_thread_timeout_add_seconds(guint interval,
GSourceFunc function, gpointer data) GSourceFunc function, gpointer data)
{ {
GSource *source = g_timeout_source_new_seconds(interval); GSource *source = g_timeout_source_new_seconds(interval);
g_source_set_callback(source, function, data, NULL); g_source_set_callback(source, function, data, NULL);
guint id = g_source_attach(source, io.context); g_source_attach(source, io.context);
g_source_unref(source); return source;
return id;
} }
struct call_data { struct call_data {
......
...@@ -62,7 +62,8 @@ io_thread_inside(void); ...@@ -62,7 +62,8 @@ io_thread_inside(void);
guint guint
io_thread_idle_add(GSourceFunc function, gpointer data); io_thread_idle_add(GSourceFunc function, gpointer data);
guint G_GNUC_MALLOC
GSource *
io_thread_timeout_add_seconds(guint interval, io_thread_timeout_add_seconds(guint interval,
GSourceFunc function, gpointer data); GSourceFunc function, gpointer data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment