| 1 | #include <pthread.h> |
| 2 | |
| 3 | typedef struct Future_WatcherSpec Future_WatcherSpec; |
| 4 | |
| 5 | typedef enum Future_State { |
| 6 | Future_State_Waiting, |
| 7 | Future_State_Done |
| 8 | } Future_State; |
| 9 | |
| 10 | struct Future { |
| 11 | Future_vfptrs_t *vfptrs; |
| 12 | Future_State state; |
| 13 | void *value; |
| 14 | bool canceled; |
| 15 | pthread_mutex_t mutex; |
| 16 | Future_WatcherSpec *watchers; |
| 17 | int nwatchers; |
| 18 | int maxwatchers; |
| 19 | }; |
| 20 |