summaryrefslogtreecommitdiff
path: root/common/library.h
Commit message (Collapse)AuthorAgeFilesLines
* virtual: Move mutex into p11_library_init()Daiki Ueno2017-02-141-0/+3
| | | | | | | | | We used to provide p11_virtual_fixed_{,un}init() to only initialize a mutex used in virtual.c. That required all the tests calling virtual functions to call p11_virtual_fixed_{,un}init() in main(). For simplicity, move the mutex variable initialization into p11_library_init().
* p11-kit: Use pthread_atfork() in a safe mannerStef Walter2014-10-031-0/+2
| | | | | | | | | | | | | Instead of trying to perform actions in pthread_atfork() which are not async-signal-safe, just increment a counter so we can later tell if the process has forked. Note this does not make it safe to mix threads and forking without immediately execing. This is a far broader problem that p11-kit, however we now do the right thing when fork+exec is used from a thread. https://bugs.freedesktop.org/show_bug.cgi?id=84567
* Separate library init from message codeStef Walter2013-04-031-14/+0
| | | | | | | | | | | Put library init/uninit code its into their own statically linked library so that they don't get linked into the p11-kit executable. Refactor the message code so that the library initialization can plug in its per thread message buffer. https://bugs.freedesktop.org/show_bug.cgi?id=63046
* Only do shared object and DLL initialization in librariesStef Walter2013-02-201-0/+2
| | | | | | Don't do library initialization on shared object load when not running in a library. We'll want to plug into this and do different things per library in the future.
* Add internal function for turning on messagesStef Walter2013-02-051-0/+2
| | | | To be used from tests
* Only initialize p11-kit libraries onceStef Walter2013-01-091-2/+4
| | | | * Make the gcc constructor call p11_library_init_once()
* Move debug and library code into the common/ subdirectoryStef Walter2013-01-091-0/+80
Start using p11_ as our internal prefix rather than _p11_. We explicitly export p11_kit_ so this is fine as far as visibility. Move the threading, mutex, and module compat, dict, and array code into the common directory too. Take this opportunity to clean up a bit of internal API as well, since so many lines are being touched internally.