Commit 4a75acb4 authored by Max Kellermann's avatar Max Kellermann

io_thread: add function io_thread_run()

parent 45336807
......@@ -31,13 +31,19 @@ static struct {
GThread *thread;
} io;
static gpointer
io_thread_func(G_GNUC_UNUSED gpointer arg)
void
io_thread_run(void)
{
assert(io.context != NULL);
assert(io.loop != NULL);
g_main_loop_run(io.loop);
}
static gpointer
io_thread_func(G_GNUC_UNUSED gpointer arg)
{
io_thread_run();
return NULL;
}
......
......@@ -29,6 +29,14 @@ io_thread_init(void);
bool
io_thread_start(GError **error_r);
/**
* Run the I/O event loop synchronously in the current thread. This
* can be called instead of io_thread_start(). For testing purposes
* only.
*/
void
io_thread_run(void);
void
io_thread_deinit(void);
......
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