| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#pragma once |
| 23 |
|
| 24 |
#ifndef PACKAGE_VERSION |
| 25 |
# error "config.h must be included before dex-future-private.h" |
| 26 |
#endif |
| 27 |
|
| 28 |
#include "dex-future.h" |
| 29 |
#include "dex-object-private.h" |
| 30 |
|
| 31 |
G_BEGIN_DECLS |
| 32 |
|
| 33 |
#define DEX_FUTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, DEX_TYPE_FUTURE, DexFutureClass)) |
| 34 |
#define DEX_FUTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS(obj, DEX_TYPE_FUTURE, DexFutureClass)) |
| 35 |
|
| 36 |
typedef struct _DexScheduler DexScheduler; |
| 37 |
|
| 38 |
typedef struct _DexFuture |
| 39 |
{ |
| 40 |
DexObject parent_instance; |
| 41 |
GValue resolved; |
| 42 |
GError *rejected; |
| 43 |
GQueue chained; |
| 44 |
GList task_group_link; |
| 45 |
const char *name; |
| 46 |
DexFutureStatus status : 2; |
| 47 |
} DexFuture; |
| 48 |
|
| 49 |
typedef struct _DexFutureClass |
| 50 |
{ |
| 51 |
DexObjectClass parent_class; |
| 52 |
|
| 53 |
gboolean (*propagate) (DexFuture *future, |
| 54 |
DexFuture *completed); |
| 55 |
void (*discard) (DexFuture *future); |
| 56 |
} DexFutureClass; |
| 57 |
|
| 58 |
void dex_future_chain (DexFuture *future, |
| 59 |
DexFuture *chained); |
| 60 |
void dex_future_complete (DexFuture *future, |
| 61 |
const GValue *value, |
| 62 |
GError *error); |
| 63 |
void dex_future_complete_steal (DexFuture *future, |
| 64 |
GValue *value, |
| 65 |
GError *error); |
| 66 |
void dex_future_complete_from (DexFuture *future, |
| 67 |
DexFuture *completed); |
| 68 |
void dex_future_discard (DexFuture *future, |
| 69 |
DexFuture *chained); |
| 70 |
const GValue *dex_await_borrowed (DexFuture *future, |
| 71 |
GError **error); |
| 72 |
void dex_future_disown_full (DexFuture *future, |
| 73 |
DexScheduler *scheduler); |
| 74 |
|
| 75 |
G_END_DECLS |