diff options
Diffstat (limited to 'src/lib/shm_rbuff_ll.c')
-rw-r--r-- | src/lib/shm_rbuff_ll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/shm_rbuff_ll.c b/src/lib/shm_rbuff_ll.c index d777de8b..1e072b21 100644 --- a/src/lib/shm_rbuff_ll.c +++ b/src/lib/shm_rbuff_ll.c @@ -244,14 +244,14 @@ int shm_rbuff_write(struct shm_rbuff * rb, nhead = RB_HEAD; + *(rb->shm_base + nhead) = (ssize_t) idx; + do { ohead = nhead; nhead = (ohead + 1) & ((SHM_BUFFER_SIZE) - 1); nhead = __sync_val_compare_and_swap(rb->head, ohead, nhead); } while (nhead != ohead); - *(rb->shm_base + nhead) = (ssize_t) idx; - if (was_empty) pthread_cond_broadcast(rb->add); |