p11_kit_initialize_registered in a constructor

Nikos Mavrogiannopoulos nmav at redhat.com
Thu Dec 5 01:51:42 PST 2013

On Thu, 2013-12-05 at 07:25 +0100, Stef Walter wrote:

> By default (unless P11_KIT_MODULE_UNMANAGED was set as a module flag),
> p11_kit_modules_initialize() can be called multiple times and
> concurrently, and does appropriate locking.
> Ditto for p11_kit_modules_load().
> Just make sure you call p11_kit_modules_finalize() and
> p11_kit_modules_release() the same amount of times, respectively.

That's not so elegant, as in a forked process
p11_kit_modules_initialize() will be called multiple times (once per
fork). Thus deinitialization will be cumbersome, as
p11_kit_modules_finalize will have to be called a number of times
depending on the number of forks (which will be unknown at that time
unless some external accounting is kept). 


More information about the p11-glue mailing list