aboutsummaryrefslogtreecommitdiff
path: root/src/ccapi/lib/ccapi_context.c
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2008-09-04 18:43:14 +0000
committerAlexandra Ellwood <lxs@mit.edu>2008-09-04 18:43:14 +0000
commite472b5dd07e78f0180f4fbf5f22fc2fff2ab2548 (patch)
treed8e92c566046b39c8fa8de207ee77d52b79261b4 /src/ccapi/lib/ccapi_context.c
parentde5ddef09b291bd0c6e933a65fcdaf63aee2f7df (diff)
downloadkrb5-e472b5dd07e78f0180f4fbf5f22fc2fff2ab2548.zip
krb5-e472b5dd07e78f0180f4fbf5f22fc2fff2ab2548.tar.gz
krb5-e472b5dd07e78f0180f4fbf5f22fc2fff2ab2548.tar.bz2
CCAPI should only use one pthread key
Use k5 thread functions. Also add destructors so if we ever have a way to detect application exit that the pthread key is destroyed. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20705 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/lib/ccapi_context.c')
-rw-r--r--src/ccapi/lib/ccapi_context.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ccapi/lib/ccapi_context.c b/src/ccapi/lib/ccapi_context.c
index 3b8d60e..640e153 100644
--- a/src/ccapi/lib/ccapi_context.c
+++ b/src/ccapi/lib/ccapi_context.c
@@ -80,6 +80,7 @@ static cc_int32 cci_context_sync (cci_context_t in_context,
#endif
MAKE_INIT_FUNCTION(cci_thread_init);
+MAKE_FINI_FUNCTION(cci_thread_fini);
/* ------------------------------------------------------------------------ */
@@ -98,6 +99,19 @@ static int cci_thread_init (void)
return err;
}
+/* ------------------------------------------------------------------------ */
+
+static void cci_thread_fini (void)
+{
+ if (!INITIALIZER_RAN (cci_thread_init) || PROGRAM_EXITING ()) {
+ return;
+ }
+
+ cci_context_change_time_thread_fini ();
+ cci_ipc_thread_fini ();
+}
+
+
#ifdef TARGET_OS_MAC
#pragma mark -
#endif