use channels to syncronize GAsync callbacks
channels are more idiomatic
This commit is contained in:
parent
16e396efc3
commit
a6ada7a1b4
|
@ -138,7 +138,7 @@ gboolean coio_task_wakeup_helper(gpointer task)
|
||||||
void coio_gasyncresult_wakeup_helper(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
void coio_gasyncresult_wakeup_helper(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||||
{
|
{
|
||||||
(void)source_object;
|
(void)source_object;
|
||||||
CoioGAsyncResultHelper* helper = (CoioGAsyncResultHelper*)user_data;
|
CoioChannel* ch = (CoioChannel*)user_data;
|
||||||
helper->res = g_object_ref(res);
|
|
||||||
coio_ready(helper->task);
|
coio_channbsendp(ch, g_object_ref(res));
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,6 @@
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
#include "coio.h"
|
#include "coio.h"
|
||||||
|
|
||||||
typedef struct async_helper {
|
|
||||||
CoioTask* task;
|
|
||||||
GAsyncResult* res;
|
|
||||||
} CoioGAsyncResultHelper;
|
|
||||||
|
|
||||||
GSource* coio_gsource_create();
|
GSource* coio_gsource_create();
|
||||||
gboolean coio_task_wakeup_helper(gpointer task);
|
gboolean coio_task_wakeup_helper(gpointer task);
|
||||||
void coio_gasyncresult_wakeup_helper(GObject *source_object, GAsyncResult *res, gpointer user_data);
|
void coio_gasyncresult_wakeup_helper(GObject *source_object, GAsyncResult *res, gpointer user_data);
|
||||||
|
|
Loading…
Reference in a new issue