mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 00:37:35 +02:00
WIP
This commit is contained in:
parent
bd11b9c7fa
commit
6d1c73b7b4
1 changed files with 15 additions and 10 deletions
|
@ -94,16 +94,21 @@ ck_array_commit(ck_array_t *array);
|
|||
|
||||
// Can we safely lock the array, make a copy, and interate over that????
|
||||
#define CK_ARRAY_FOREACH(a, i, b) \
|
||||
TODO:
|
||||
pthread_mutex_lock(&(array->lock));
|
||||
hashset_remove(array->hs, pointer);
|
||||
pthread_mutex_unlock(&(array->lock));
|
||||
// (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++)
|
||||
pthread_mutex_lock(&(a->lock));
|
||||
size_t *tmp = calloc(a->hs->nitems, sizeof(struct hashset_st));
|
||||
int tmpc = a->hs->nitems;
|
||||
// TODO: just do this in the loop below, this is unnecessary
|
||||
for (unsigned int tmpi = 0, tmpii = 0; tmpi < tmpc; tmpi++) {
|
||||
if (a->hs->items != 0 && a->hs->items != 1) {
|
||||
tmp[tmpii] = a->hs->items[tmpi];
|
||||
tmpii++;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&(a->lock));
|
||||
for (unsigned int _ck_i = 0;
|
||||
_ck_i < (a)->active->n_committed &&
|
||||
((*b) = (a)->active->values[_ck_i], 1);
|
||||
_ck_i++)
|
||||
|
||||
// CAS section
|
||||
bool
|
||||
|
|
Loading…
Add table
Reference in a new issue