From e472b5dd07e78f0180f4fbf5f22fc2fff2ab2548 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Thu, 4 Sep 2008 18:43:14 +0000 Subject: 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 --- src/ccapi/lib/ccapi_context.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/ccapi/lib/ccapi_context.c') diff --git a/src/ccapi/lib/ccapi_context.c b/src/ccapi/lib/ccapi_context.c index 3b8d60e3e..640e153e8 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 -- cgit