Fix: urcu-bp: re-initialize list head on library exit
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 May 2016 18:50:01 +0000 (14:50 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 May 2016 18:52:13 +0000 (14:52 -0400)
In case an application would try to create threads after the urcu-bp
library destructor has run, make sure the arena chunk list is
re-initialized after the memory mappings are unmapped.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-bp.c

index 9d6713ef1b53aae08fae9cc975b307b040621701..f78935e1af2d5d9883946f0aef201a6928d3a90a 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -590,6 +590,7 @@ void _rcu_bp_exit(void)
                        munmap(chunk, chunk->data_len
                                        + sizeof(struct registry_chunk));
                }
                        munmap(chunk, chunk->data_len
                                        + sizeof(struct registry_chunk));
                }
+               CDS_INIT_LIST_HEAD(&registry_arena.chunk_list);
                ret = pthread_key_delete(urcu_bp_key);
                if (ret)
                        abort();
                ret = pthread_key_delete(urcu_bp_key);
                if (ret)
                        abort();
This page took 0.045327 seconds and 4 git commands to generate.