io_thread: add function _timeout_add()
Same as _timeout_add_seconds(), but this one has millisecond resolution.
This commit is contained in:
parent
2e83af7c21
commit
0c0400b6fc
|
@ -123,6 +123,15 @@ io_thread_idle_add(GSourceFunc function, gpointer data)
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GSource *
|
||||||
|
io_thread_timeout_add(guint interval_ms, GSourceFunc function, gpointer data)
|
||||||
|
{
|
||||||
|
GSource *source = g_timeout_source_new(interval_ms);
|
||||||
|
g_source_set_callback(source, function, data, NULL);
|
||||||
|
g_source_attach(source, io.context);
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
GSource *
|
GSource *
|
||||||
io_thread_timeout_add_seconds(guint interval,
|
io_thread_timeout_add_seconds(guint interval,
|
||||||
GSourceFunc function, gpointer data)
|
GSourceFunc function, gpointer data)
|
||||||
|
|
|
@ -62,6 +62,10 @@ io_thread_inside(void);
|
||||||
guint
|
guint
|
||||||
io_thread_idle_add(GSourceFunc function, gpointer data);
|
io_thread_idle_add(GSourceFunc function, gpointer data);
|
||||||
|
|
||||||
|
G_GNUC_MALLOC
|
||||||
|
GSource *
|
||||||
|
io_thread_timeout_add(guint interval_ms, GSourceFunc function, gpointer data);
|
||||||
|
|
||||||
G_GNUC_MALLOC
|
G_GNUC_MALLOC
|
||||||
GSource *
|
GSource *
|
||||||
io_thread_timeout_add_seconds(guint interval,
|
io_thread_timeout_add_seconds(guint interval,
|
||||||
|
|
Loading…
Reference in New Issue