We can now use the splice return value to know if the source queue was
empty rather than testing for destination queue emptiness after the
splice operation.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
struct cds_wfcq_head cbs_tmp_head;
struct cds_wfcq_tail cbs_tmp_tail;
struct cds_wfcq_node *cbs, *cbs_tmp_n;
struct cds_wfcq_head cbs_tmp_head;
struct cds_wfcq_tail cbs_tmp_tail;
struct cds_wfcq_node *cbs, *cbs_tmp_n;
+ enum cds_wfcq_ret splice_ret;
cds_wfcq_init(&cbs_tmp_head, &cbs_tmp_tail);
cds_wfcq_init(&cbs_tmp_head, &cbs_tmp_tail);
- __cds_wfcq_splice_blocking(&cbs_tmp_head, &cbs_tmp_tail,
- &crdp->cbs_head, &crdp->cbs_tail);
- if (!cds_wfcq_empty(&cbs_tmp_head, &cbs_tmp_tail)) {
+ splice_ret = __cds_wfcq_splice_blocking(&cbs_tmp_head,
+ &cbs_tmp_tail, &crdp->cbs_head, &crdp->cbs_tail);
+ assert(splice_ret != CDS_WFCQ_RET_WOULDBLOCK);
+ assert(splice_ret != CDS_WFCQ_RET_DEST_NON_EMPTY);
+ if (splice_ret != CDS_WFCQ_RET_SRC_EMPTY) {
synchronize_rcu();
cbcount = 0;
__cds_wfcq_for_each_blocking_safe(&cbs_tmp_head,
synchronize_rcu();
cbcount = 0;
__cds_wfcq_for_each_blocking_safe(&cbs_tmp_head,