From f6d18c6478b943f852d1a70fcae165fad08f019a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 28 Sep 2009 20:15:29 -0400 Subject: [PATCH] urcu-qsbr: Add list sanity check at lib exit Signed-off-by: Mathieu Desnoyers --- urcu-qsbr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/urcu-qsbr.c b/urcu-qsbr.c index c603c1d..7889506 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -37,6 +37,8 @@ /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ #include "urcu-qsbr.h" +void __attribute__((destructor)) rcu_exit(void); + static pthread_mutex_t urcu_mutex = PTHREAD_MUTEX_INITIALIZER; int gp_futex; @@ -333,3 +335,8 @@ void rcu_unregister_thread(void) list_del(&urcu_reader.head); internal_urcu_unlock(); } + +void rcu_exit(void) +{ + assert(list_empty(®istry)); +} -- 2.34.1