This commit is contained in:
Justin Ethier 2021-01-06 14:55:56 -08:00
parent bd11b9c7fa
commit 6d1c73b7b4

View file

@ -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