37 #include "rt-hclib-def.h"
38 #include "runtime-support.h"
39 #include "runtime-hclib.h"
48 static int runtime_on = 0;
53 assert(0 &&
"hc_init called twice in a row");
57 runtime_init(argc, argv);
61 root_async_task = allocate_async_task(NULL);
62 set_current_async(root_async_task);
77 free(root_async_task);
82 assert(0 &&
"hc_finalize called without any matching hc_init");
94 finish_t * finish = allocate_finish();
95 assert(finish &&
"malloc failed");
98 finish->accumulators = NULL;
101 finish->owner = get_worker_id_hc();
105 finish->parent = async_task->current_finish;
107 async_task->current_finish = finish;
115 finish_t * current_finish = async->current_finish;
117 if (current_finish->counter > 1) {
121 help_finish(current_finish);
125 end_finish_notify(current_finish);
128 async->current_finish = current_finish->parent;
131 set_current_async(async);
133 deallocate_finish(current_finish);
137 struct ddf_st ** ddf_list,
struct _phased_t * phased_clause,
int property) {
138 #if CHECKED_EXECUTION
143 async_def.fct_ptr = fct_ptr;
145 async_def.ddf_list = ddf_list;
147 async_def.phased_clause = phased_clause;
151 async_task_t * async_task = allocate_async_task(&async_def);
152 schedule_async(async_task, get_current_finish(), property);