From: Mathieu Desnoyers Date: Tue, 29 Sep 2009 00:15:29 +0000 (-0400) Subject: urcu-qsbr: Add list sanity check at lib exit X-Git-Tag: v0.1~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f6d18c6478b943f852d1a70fcae165fad08f019a;p=urcu.git urcu-qsbr: Add list sanity check at lib exit Signed-off-by: Mathieu Desnoyers --- 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)); +}