summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-10-29 01:29:04 -0700
committerStef Walter <stefw@collabora.co.uk>2011-10-29 01:29:04 -0700
commit922d53016955c0ff2d6d830d726f0d1ea3a5804b (patch)
tree586e9d4fd7cf359650a4c54dae6db95b624f458b /p11-kit
parentc940667c434fe64cf4d01cec0873044c54e7f174 (diff)
Add debug output to windows init and uninit of library
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/p11-kit/util.c b/p11-kit/util.c
index b340ebd..c7f6138 100644
--- a/p11-kit/util.c
+++ b/p11-kit/util.c
@@ -36,6 +36,7 @@
#include "config.h"
+#define DEBUG_FLAG DEBUG_LIB
#include "debug.h"
#include "p11-kit.h"
#include "private.h"
@@ -309,6 +310,7 @@ void
_p11_library_init (void)
{
_p11_debug_init ();
+ _p11_debug ("initializing library");
_p11_mutex_init (&_p11_mutex);
thread_local = TlsAlloc ();
}
@@ -327,6 +329,8 @@ _p11_library_uninit (void)
{
LPVOID data;
+ _p11_debug ("uninitializing library");
+
if (thread_local != TLS_OUT_OF_INDEXES) {
data = TlsGetValue (thread_local);
free_tls_value (data);
@@ -345,12 +349,15 @@ DllMain (HINSTANCE instance,
switch (reason) {
case DLL_PROCESS_ATTACH:
_p11_library_init ();
- if (thread_local == TLS_OUT_OF_INDEXES)
+ if (thread_local == TLS_OUT_OF_INDEXES) {
+ _p11_debug ("couldn't setup tls");
return FALSE;
+ }
break;
case DLL_THREAD_DETACH:
if (thread_local != TLS_OUT_OF_INDEXES) {
+ _p11_debug ("thread stopped, freeing tls");
data = TlsGetValue (thread_local);
free_tls_value (data);
}