smp_wmb(); /* Publish new pointer before write q[] */
if (unlikely(defer_queue.last_fct_in != fct)) {
- //printf("fct diff %p %p\n", defer_queue.last_fct, fct);
defer_queue.last_fct_in = fct;
if (unlikely(DQ_IS_FCT_BIT(fct) || fct == DQ_FCT_MARK)) {
/*
fct);
}
} else {
- //printf("fct same %p\n", fct);
if (unlikely(DQ_IS_FCT_BIT(p) || p == DQ_FCT_MARK)) {
/*
* If the data to encode is not aligned or the marker,
smp_rmb(); /* read head before q[]. */
p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
if (unlikely(DQ_IS_FCT_BIT(p))) {
- //printf("%lu fct bit %p\n", i-1, p);
DQ_CLEAR_FCT_BIT(p);
queue->last_fct_out = p;
p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
} else if (unlikely(p == DQ_FCT_MARK)) {
- //printf("%lu fct mark %p\n", i-1, p);
p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
queue->last_fct_out = p;
p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
- }// else
- //printf("%lu data %p\n", i-1, p);
+ }
fct = queue->last_fct_out;
- //printf("tid %lu %lu last_fct %p data %p\n", pthread_self(), i-1, fct, p);
fct(p);
}
smp_mb(); /* push tail after having used q[] */