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:51:49 +0000 (14:51 -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 22e17ccdd0a81eafe3b49917bb610f10a5e2ac3c..cbdebf407a892c2d201d42d948025723702414e7 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -612,6 +612,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.025627 seconds and 4 git commands to generate.