io_thread: add function io_thread_run()
This commit is contained in:
parent
453368078b
commit
4a75acb46c
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue