|
|
@ -76,7 +76,7 @@ ck_hp_fifo_enqueue_mpmc(ck_hp_record_t *record,
|
|
|
|
|
|
|
|
|
|
|
|
entry->value = value;
|
|
|
|
entry->value = value;
|
|
|
|
entry->next = NULL;
|
|
|
|
entry->next = NULL;
|
|
|
|
ck_pr_fence_store();
|
|
|
|
ck_pr_fence_store_atomic();
|
|
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
for (;;) {
|
|
|
|
tail = ck_pr_load_ptr(&fifo->tail);
|
|
|
|
tail = ck_pr_load_ptr(&fifo->tail);
|
|
|
@ -93,7 +93,7 @@ ck_hp_fifo_enqueue_mpmc(ck_hp_record_t *record,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ck_pr_fence_store();
|
|
|
|
ck_pr_fence_atomic();
|
|
|
|
ck_pr_cas_ptr(&fifo->tail, tail, entry);
|
|
|
|
ck_pr_cas_ptr(&fifo->tail, tail, entry);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -108,7 +108,7 @@ ck_hp_fifo_tryenqueue_mpmc(ck_hp_record_t *record,
|
|
|
|
|
|
|
|
|
|
|
|
entry->value = value;
|
|
|
|
entry->value = value;
|
|
|
|
entry->next = NULL;
|
|
|
|
entry->next = NULL;
|
|
|
|
ck_pr_fence_store();
|
|
|
|
ck_pr_fence_store_atomic();
|
|
|
|
|
|
|
|
|
|
|
|
tail = ck_pr_load_ptr(&fifo->tail);
|
|
|
|
tail = ck_pr_load_ptr(&fifo->tail);
|
|
|
|
ck_hp_set(record, 0, tail);
|
|
|
|
ck_hp_set(record, 0, tail);
|
|
|
@ -123,7 +123,7 @@ ck_hp_fifo_tryenqueue_mpmc(ck_hp_record_t *record,
|
|
|
|
} else if (ck_pr_cas_ptr(&fifo->tail->next, next, entry) == false)
|
|
|
|
} else if (ck_pr_cas_ptr(&fifo->tail->next, next, entry) == false)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
ck_pr_fence_store();
|
|
|
|
ck_pr_fence_atomic();
|
|
|
|
ck_pr_cas_ptr(&fifo->tail, tail, entry);
|
|
|
|
ck_pr_cas_ptr(&fifo->tail, tail, entry);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|