urcu (mb/signal): fix list move implementation
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 29 Sep 2009 03:07:36 +0000 (23:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 29 Sep 2009 03:07:36 +0000 (23:07 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu.c

diff --git a/urcu.c b/urcu.c
index e70980f5b93e259f5506e3fb7e1b602708aa63b3..7fdb1a6a675692cf8e25c39bfd6dde1f1e68f82a 100644 (file)
--- 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(&registry))
                return;
@@ -231,7 +231,7 @@ void wait_for_quiescent_state(void)
                        force_mb_all_threads();
                }
 
-               list_for_each_entry(index, &registry, head) {
+               list_for_each_entry_safe(index, tmp, &registry, 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, &registry);
+       list_splice(&qsreaders, &registry);
 }
 
 void synchronize_rcu(void)
This page took 0.026564 seconds and 4 git commands to generate.