|
|
|
@ -61,20 +61,18 @@ ck_hp_stack_pop_mpmc(ck_hp_record_t *record, struct ck_stack *target)
|
|
|
|
|
if (entry == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
ck_hp_set(record, 0, entry);
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
ck_hp_set_fence(record, 0, entry);
|
|
|
|
|
} while (entry != ck_pr_load_ptr(&target->head));
|
|
|
|
|
|
|
|
|
|
while (ck_pr_cas_ptr_value(&target->head, entry, entry->next, &entry) == false) {
|
|
|
|
|
if (entry == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
ck_hp_set(record, 0, entry);
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
ck_hp_set_fence(record, 0, entry);
|
|
|
|
|
|
|
|
|
|
update = ck_pr_load_ptr(&target->head);
|
|
|
|
|
while (entry != update) {
|
|
|
|
|
ck_hp_set(record, 0, update);
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
ck_hp_set_fence(record, 0, update);
|
|
|
|
|
entry = update;
|
|
|
|
|
update = ck_pr_load_ptr(&target->head);
|
|
|
|
|
if (update == NULL)
|
|
|
|
@ -94,8 +92,7 @@ ck_hp_stack_trypop_mpmc(ck_hp_record_t *record, struct ck_stack *target, struct
|
|
|
|
|
if (entry == NULL)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
ck_hp_set(record, 0, entry);
|
|
|
|
|
ck_pr_fence_store_load();
|
|
|
|
|
ck_hp_set_fence(record, 0, entry);
|
|
|
|
|
if (entry != ck_pr_load_ptr(&target->head))
|
|
|
|
|
goto leave;
|
|
|
|
|
|
|
|
|
|