diff --git a/ck_pr.h b/ck_pr.h index 73e94565..db01cd8c 100644 --- a/ck_pr.h +++ b/ck_pr.h @@ -2,6 +2,21 @@ #define CYCLONE_CK_POLYFILL_H #include +#include + + // toDO: ck_array support + ck_array_iterator_t iterator; + // TODO: + +// Can we safely lock the array, make a copy, and interate over that???? +#define CK_ARRAY_FOREACH(a, i, b) \ + (i)->snapshot = ck_pr_load_ptr(&(a)->active); \ + ck_pr_fence_load(); \ + for (unsigned int _ck_i = 0; \ + _ck_i < (a)->active->n_committed && \ + ((*b) = (a)->active->values[_ck_i], 1); \ + _ck_i++) + bool ck_pr_cas_ptr(void *target, void *old_value, void *new_value);