X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Furcu-bp.c;h=1f9a03818228e0c72941de77baf7f3bf720cd0d9;hb=0c8eff157de6f7ab836ec87a340a517d49fdaca3;hp=c2ac792c219f825936e1e3676907e8b8cf9ea01a;hpb=c6bc6503eb6a647666dd749d89aca8e46dcba50e;p=urcu.git diff --git a/src/urcu-bp.c b/src/urcu-bp.c index c2ac792..1f9a038 100644 --- a/src/urcu-bp.c +++ b/src/urcu-bp.c @@ -75,8 +75,10 @@ void *mremap_wrapper(void *old_address, size_t old_size, * This is not generic. */ static -void *mremap_wrapper(void *old_address, size_t old_size, - size_t new_size, int flags) +void *mremap_wrapper(void *old_address __attribute__((unused)), + size_t old_size __attribute__((unused)), + size_t new_size __attribute__((unused)), + int flags) { assert(!(flags & MREMAP_MAYMOVE)); @@ -118,7 +120,10 @@ enum membarrier_cmd { static void __attribute__((constructor)) _urcu_bp_init(void); static -void __attribute__((destructor)) urcu_bp_exit(void); +void urcu_bp_exit(void); +static +void __attribute__((destructor)) urcu_bp_exit_destructor(void); +static void urcu_call_rcu_exit(void); #ifndef CONFIG_RCU_FORCE_SYS_MEMBARRIER int urcu_bp_has_sys_membarrier; @@ -678,6 +683,13 @@ void urcu_bp_exit(void) mutex_unlock(&init_lock); } +static +void urcu_bp_exit_destructor(void) +{ + urcu_call_rcu_exit(); + urcu_bp_exit(); +} + /* * Holding the rcu_gp_lock and rcu_registry_lock across fork will make * sure we fork() don't race with a concurrent thread executing with