X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu.c;h=0ebe4fd796927a7cd2d204cfff75ed746e55dc91;hb=0cdbb97c1452c0413c99db75b9841fe3b6243618;hp=e70980f5b93e259f5506e3fb7e1b602708aa63b3;hpb=cfe78e252a63a8718e0d2f819d196cee5ca3f6c1;p=urcu.git diff --git a/urcu.c b/urcu.c index e70980f..0ebe4fd 100644 --- a/urcu.c +++ b/urcu.c @@ -208,7 +208,7 @@ static void wait_gp(void) /* Read reader_gp before read futex */ force_mb_all_threads(); if (uatomic_read(&gp_futex) == -1) - futex(&gp_futex, FUTEX_WAIT, -1, + futex_async(&gp_futex, FUTEX_WAIT, -1, NULL, NULL, 0); } @@ -216,7 +216,7 @@ void wait_for_quiescent_state(void) { LIST_HEAD(qsreaders); int wait_loops = 0; - struct urcu_reader *index; + struct urcu_reader *index, *tmp; if (list_empty(®istry)) return; @@ -231,7 +231,7 @@ void wait_for_quiescent_state(void) force_mb_all_threads(); } - list_for_each_entry(index, ®istry, head) { + list_for_each_entry_safe(index, tmp, ®istry, head) { if (!rcu_old_gp_ongoing(&index->ctr)) list_move(&index->head, &qsreaders); } @@ -278,7 +278,7 @@ void wait_for_quiescent_state(void) #endif /* #else #ifndef HAS_INCOHERENT_CACHES */ } /* put back the reader list in the registry */ - list_move(&qsreaders, ®istry); + list_splice(&qsreaders, ®istry); } void synchronize_rcu(void) @@ -372,38 +372,6 @@ void rcu_read_unlock(void) _rcu_read_unlock(); } -void *rcu_dereference(void *p) -{ - return _rcu_dereference(p); -} - -void *rcu_assign_pointer_sym(void **p, void *v) -{ - wmb(); - return STORE_SHARED(p, v); -} - -void *rcu_xchg_pointer_sym(void **p, void *v) -{ - wmb(); - return uatomic_xchg(p, v); -} - -void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) -{ - wmb(); - return uatomic_cmpxchg(p, old, _new); -} - -void *rcu_publish_content_sym(void **p, void *v) -{ - void *oldptr; - - oldptr = _rcu_xchg_pointer(p, v); - synchronize_rcu(); - return oldptr; -} - void rcu_register_thread(void) { urcu_reader.tid = pthread_self();