diff options
author | dimitri staessens <[email protected]> | 2016-08-06 12:51:26 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-08-06 12:51:26 +0200 |
commit | 8450af0e2950e5a1415e38702d6169cc8a732294 (patch) | |
tree | 617e3002ffa5addb364c01d5cd925d8c609b12b5 /src/lib | |
parent | 656fb082a3ab596555ba661ee98ab8400f9dd4f1 (diff) | |
download | ouroboros-8450af0e2950e5a1415e38702d6169cc8a732294.tar.gz ouroboros-8450af0e2950e5a1415e38702d6169cc8a732294.zip |
lib: shm_ap_rbuff: Remove obsolete clean function
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/shm_ap_rbuff.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c index 20bea843..e9c51533 100644 --- a/src/lib/shm_ap_rbuff.c +++ b/src/lib/shm_ap_rbuff.c @@ -52,9 +52,6 @@ #define shm_rbuff_empty(rb) (*rb->ptr_head == *rb->ptr_tail) #define head_el_ptr(rb) (rb->shm_base + *rb->ptr_head) #define tail_el_ptr(rb) (rb->shm_base + *rb->ptr_tail) -#define clean_sdus(rb) \ - while (!shm_rbuff_empty(rb) && tail_el_ptr(rb)->port_id < 0) \ - *rb->ptr_tail = (*rb->ptr_tail + 1) & (SHM_BUFFER_SIZE -1); \ struct shm_ap_rbuff { struct rb_entry * shm_base; /* start of entry */ @@ -316,8 +313,6 @@ int shm_ap_rbuff_peek(struct shm_ap_rbuff * rb, pthread_mutex_consistent(rb->lock); } - clean_sdus(rb); - while (shm_rbuff_empty(rb)) { if (timeout != NULL) ret = pthread_cond_timedwait(rb->add, @@ -326,8 +321,6 @@ int shm_ap_rbuff_peek(struct shm_ap_rbuff * rb, else ret = pthread_cond_wait(rb->add, rb->lock); - clean_sdus(rb); - if (ret == EOWNERDEAD) { LOG_DBG("Recovering dead mutex."); pthread_mutex_consistent(rb->lock); @@ -361,8 +354,6 @@ struct rb_entry * shm_ap_rbuff_read(struct shm_ap_rbuff * rb) pthread_mutex_consistent(rb->lock); } - clean_sdus(rb); - while (shm_rbuff_empty(rb)) if (pthread_cond_wait(rb->add, rb->lock) == EOWNERDEAD) { LOG_DBG("Recovering dead mutex."); @@ -393,8 +384,6 @@ ssize_t shm_ap_rbuff_read_port(struct shm_ap_rbuff * rb, int port_id) pthread_mutex_consistent(rb->lock); } - clean_sdus(rb); - if (shm_rbuff_empty(rb) || tail_el_ptr(rb)->port_id != port_id) { pthread_mutex_unlock(rb->lock); return -1; @@ -429,8 +418,6 @@ ssize_t shm_ap_rbuff_read_port_b(struct shm_ap_rbuff * rb, ts_add(&abstime, timeout, &abstime); } - clean_sdus(rb); - pthread_cleanup_push((void(*)(void *))pthread_mutex_unlock, (void *) rb->lock); @@ -442,8 +429,6 @@ ssize_t shm_ap_rbuff_read_port_b(struct shm_ap_rbuff * rb, else ret = pthread_cond_wait(rb->del, rb->lock); - clean_sdus(rb); - if (ret == EOWNERDEAD) { LOG_DBG("Recovering dead mutex."); pthread_mutex_consistent(rb->lock); |