From: Mathieu Desnoyers Date: Tue, 29 Sep 2009 03:07:36 +0000 (-0400) Subject: urcu (mb/signal): fix list move implementation X-Git-Tag: v0.1~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=23758cc9e9aa85a1ed3864674829d60f3a715353;p=urcu.git urcu (mb/signal): fix list move implementation Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu.c b/urcu.c index e70980f..7fdb1a6 100644 --- a/urcu.c +++ b/urcu.c @@ -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)