X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-defer.c;h=796e7e10088ce3ab5063b6a14ef0b72d24d57fa3;hp=c28e8488354e4138f24114200258eb3abdf7f3d3;hb=16aa9ee87cf4364921c36025359be01390338d87;hpb=06f22bdbb0c4c4d5db42a2e2dc35818aa61415be diff --git a/urcu-defer.c b/urcu-defer.c index c28e848..796e7e1 100644 --- a/urcu-defer.c +++ b/urcu-defer.c @@ -54,7 +54,7 @@ static int defer_thread_futex; * the reclamation tread. */ static struct defer_queue __thread defer_queue; -static LIST_HEAD(registry); +static CDS_LIST_HEAD(registry); static pthread_t tid_defer; static void mutex_lock(pthread_mutex_t *mutex) @@ -109,7 +109,7 @@ static unsigned long rcu_defer_num_callbacks(void) struct defer_queue *index; mutex_lock(&rcu_defer_mutex); - list_for_each_entry(index, ®istry, list) { + cds_list_for_each_entry(index, ®istry, list) { head = CAA_LOAD_SHARED(index->head); num_items += head - index->tail; } @@ -207,11 +207,11 @@ void rcu_defer_barrier(void) struct defer_queue *index; unsigned long num_items = 0; - if (list_empty(®istry)) + if (cds_list_empty(®istry)) return; mutex_lock(&rcu_defer_mutex); - list_for_each_entry(index, ®istry, list) { + cds_list_for_each_entry(index, ®istry, list) { index->last_head = CAA_LOAD_SHARED(index->head); num_items += index->last_head - index->tail; } @@ -223,7 +223,7 @@ void rcu_defer_barrier(void) goto end; } synchronize_rcu(); - list_for_each_entry(index, ®istry, list) + cds_list_for_each_entry(index, ®istry, list) rcu_defer_barrier_queue(index, index->last_head); end: mutex_unlock(&rcu_defer_mutex); @@ -349,8 +349,8 @@ void rcu_defer_register_thread(void) mutex_lock(&defer_thread_mutex); mutex_lock(&rcu_defer_mutex); - was_empty = list_empty(®istry); - list_add(&defer_queue.list, ®istry); + was_empty = cds_list_empty(®istry); + cds_list_add(&defer_queue.list, ®istry); mutex_unlock(&rcu_defer_mutex); if (was_empty) @@ -364,11 +364,11 @@ void rcu_defer_unregister_thread(void) mutex_lock(&defer_thread_mutex); mutex_lock(&rcu_defer_mutex); - list_del(&defer_queue.list); + cds_list_del(&defer_queue.list); _rcu_defer_barrier_thread(); free(defer_queue.q); defer_queue.q = NULL; - is_empty = list_empty(®istry); + is_empty = cds_list_empty(®istry); mutex_unlock(&rcu_defer_mutex); if (is_empty) @@ -378,5 +378,5 @@ void rcu_defer_unregister_thread(void) void rcu_defer_exit(void) { - assert(list_empty(®istry)); + assert(cds_list_empty(®istry)); }