mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
a461da48cd
commit
c6431bfc35
1 changed files with 15 additions and 0 deletions
15
ck_pr.h
15
ck_pr.h
|
@ -2,6 +2,21 @@
|
|||
#define CYCLONE_CK_POLYFILL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue